diff --git a/src/app/services/format.service.ts b/src/app/services/format.service.ts index 722f25a8a0188f9c85742e343b50e66f59a167c7..bd2b12a3a6c1c5b27570b675282159bf9922bfa4 100644 --- a/src/app/services/format.service.ts +++ b/src/app/services/format.service.ts @@ -58,18 +58,18 @@ export class FormatService { } delete(id) { - return this._httpClient.delete(this.formatServiceUrl + id); + return this._httpClient.delete(this.formatServiceUrl + id, { withCredentials: true }); } replaceOrCreate(data): Observable<Format> { if (data.id) { - return this._httpClient.put<IFormat>(this.formatServiceUrl + data.id, data).pipe( + return this._httpClient.put<IFormat>(this.formatServiceUrl + data.id, data, { withCredentials: true }).pipe( map((response) => { return new Format(response); }), ); } - return this._httpClient.post<IFormat>(this.formatServiceUrl, data).pipe( + return this._httpClient.post<IFormat>(this.formatServiceUrl, data, { withCredentials: true }).pipe( map((response) => { return new Format(response); }), diff --git a/src/app/services/resource.service.ts b/src/app/services/resource.service.ts index b598eb31653bfe0f7fd8005c2d93a78bb996abf5..a46b3d35be2e366d01c26696c4b87fa7ab1db43f 100644 --- a/src/app/services/resource.service.ts +++ b/src/app/services/resource.service.ts @@ -52,18 +52,18 @@ export class ResourceService { } delete(id) { - return this._httpClient.delete(this.resourceServiceUrl + id); + return this._httpClient.delete(this.resourceServiceUrl + id, { withCredentials: true }); } replaceOrCreate(data): Observable<Resource> { if (data.id) { - return this._httpClient.put<IResource>(this.resourceServiceUrl + data.id, data).pipe( + return this._httpClient.put<IResource>(this.resourceServiceUrl + data.id, data, { withCredentials: true }).pipe( map((response) => { return new Resource(response); }), ); } - return this._httpClient.post<IResource>(this.resourceServiceUrl, data).pipe( + return this._httpClient.post<IResource>(this.resourceServiceUrl, data, { withCredentials: true }).pipe( map((response) => { return new Resource(response); }), @@ -73,7 +73,7 @@ export class ResourceService { createResourceFormats(resourceId: string, resourceFormats: IResourceFormat[]): Observable<IResourceFormat> { return from(resourceFormats).pipe( concatMap((rf) => { - return this._httpClient.post<IResourceFormat>(`${this.resourceServiceUrl}${resourceId}/formats`, rf); + return this._httpClient.post<IResourceFormat>(`${this.resourceServiceUrl}${resourceId}/formats`, rf, { withCredentials: true }); }), ); } @@ -81,7 +81,11 @@ export class ResourceService { updateResourceFormats(resourceId: string, resourceFormats: IResourceFormat[]) { return from(resourceFormats).pipe( concatMap((rf) => { - return this._httpClient.put<IResourceFormat>(`${this.resourceServiceUrl}${resourceId}/formats/${rf.id}`, rf); + return this._httpClient.put<IResourceFormat>( + `${this.resourceServiceUrl}${resourceId}/formats/${rf.id}`, + rf, + { withCredentials: true }, + ); }), ); } @@ -89,7 +93,10 @@ export class ResourceService { deleteResourceFormats(resourceId: string, resourceFormatsId: string[]) { return from(resourceFormatsId).pipe( concatMap((rfId) => { - return this._httpClient.delete<IResourceFormat>(`${this.resourceServiceUrl}${resourceId}/formats/${rfId}`); + return this._httpClient.delete<IResourceFormat>( + `${this.resourceServiceUrl}${resourceId}/formats/${rfId}`, + { withCredentials: true }, + ); }), ); }