Updated export functionality
This commit is contained in:
@@ -2,4 +2,5 @@ export interface DeltagareExportRequest {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
includeExportedDeltagare: boolean;
|
||||
exportToExcel?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Params } from '@angular/router';
|
||||
import { ErrorType } from '@msfa-enums/error-type.enum';
|
||||
import { environment } from '@msfa-environment';
|
||||
import { DeltagareExportRequest } from '@msfa-models/api/deltagare-export.request.model';
|
||||
import { Params } from '@msfa-models/api/params.model';
|
||||
import { CustomError } from '@msfa-models/error/custom-error';
|
||||
import { Observable } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -23,7 +23,7 @@ export class ExportApiService {
|
||||
};
|
||||
|
||||
return this.httpClient
|
||||
.post<Blob>(`${this._apiBaseUrl}/deltagare`, { params, responseType: 'blob' })
|
||||
.get<Blob>(`${this._apiBaseUrl}/deltagare`, { params, responseType: 'blob' as 'json' })
|
||||
.pipe(
|
||||
catchError((error: Error) => {
|
||||
throw new CustomError({
|
||||
|
||||
Reference in New Issue
Block a user