Updated error-handling inside gemensam planering
This commit is contained in:
@@ -32,17 +32,8 @@ export class GemensamPlaneringApiService {
|
||||
return this.deltagareApiService.fetchAvropInformation$(genomforandeReferens);
|
||||
}
|
||||
|
||||
public async postGemensamPlanering(requestData: GemensamPlaneringPostRequest): Promise<void> {
|
||||
return this.httpClient
|
||||
.post<void>(`${this._apiBaseUrl}`, requestData)
|
||||
.pipe(
|
||||
catchError((error: Error & { status: number }) => {
|
||||
throw new CustomError(
|
||||
errorToCustomError({ ...error, message: `Kunde inte spara gemensam planering.\n\n${error.message}` })
|
||||
);
|
||||
})
|
||||
)
|
||||
.toPromise();
|
||||
public async postGemensamPlanering$(requestData: GemensamPlaneringPostRequest): Promise<void> {
|
||||
return this.httpClient.post<void>(`${this._apiBaseUrl}`, requestData).toPromise();
|
||||
}
|
||||
|
||||
constructor(private httpClient: HttpClient, private deltagareApiService: DeltagareApiService) {}
|
||||
|
||||
Reference in New Issue
Block a user