Skip to content
Snippets Groups Projects
Commit 85c22430 authored by ncastejon's avatar ncastejon
Browse files

Fix POST for organizations

parent 0eaab1c7
Branches
Tags
No related merge requests found
......@@ -19,6 +19,7 @@ export class Organization {
this.description = '';
this.logo = '';
this.elasticSearchName = '';
this.links = [];
}
}
......
......@@ -54,7 +54,7 @@ export class OrganizationService {
return this._httpClient.delete(environment.organizations.url + id);
}
replaceOrCreate(data): Observable<Organization> {
replaceOrCreate(data: Organization): Observable<Organization> {
if (data.id) {
return this._httpClient.put<IOrganization>(environment.organizations.url + data.id, data).pipe(
map((response) => {
......@@ -62,6 +62,9 @@ export class OrganizationService {
}
));
}
data.links.forEach((link) => {
delete link.id;
});
return this._httpClient.post<IOrganization>(environment.organizations.url, data).pipe(
map((response) => {
return new Organization(response);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment