Skip to content
Snippets Groups Projects
Commit f00892d8 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add withCredential option on some http calls

parent 4a61fc32
Branches
Tags
1 merge request!3v1.1.0
Pipeline #2896 passed
......@@ -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);
}),
......
......@@ -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 },
);
}),
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment