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

Fix POST for organizations

parent 0eaab1c7
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,7 @@ export class Organization { ...@@ -19,6 +19,7 @@ export class Organization {
this.description = ''; this.description = '';
this.logo = ''; this.logo = '';
this.elasticSearchName = ''; this.elasticSearchName = '';
this.links = [];
} }
} }
......
...@@ -54,7 +54,7 @@ export class OrganizationService { ...@@ -54,7 +54,7 @@ export class OrganizationService {
return this._httpClient.delete(environment.organizations.url + id); return this._httpClient.delete(environment.organizations.url + id);
} }
replaceOrCreate(data): Observable<Organization> { replaceOrCreate(data: Organization): Observable<Organization> {
if (data.id) { if (data.id) {
return this._httpClient.put<IOrganization>(environment.organizations.url + data.id, data).pipe( return this._httpClient.put<IOrganization>(environment.organizations.url + data.id, data).pipe(
map((response) => { map((response) => {
...@@ -62,6 +62,9 @@ export class OrganizationService { ...@@ -62,6 +62,9 @@ export class OrganizationService {
} }
)); ));
} }
data.links.forEach((link) => {
delete link.id;
});
return this._httpClient.post<IOrganization>(environment.organizations.url, data).pipe( return this._httpClient.post<IOrganization>(environment.organizations.url, data).pipe(
map((response) => { map((response) => {
return new Organization(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