diff --git a/src/app/models/organization.model.ts b/src/app/models/organization.model.ts index c04111dfe231c51c9de056103a946df238b897df..53adbd907ffd027f9924c0d4b9376bcae8364a02 100644 --- a/src/app/models/organization.model.ts +++ b/src/app/models/organization.model.ts @@ -19,6 +19,7 @@ export class Organization { this.description = ''; this.logo = ''; this.elasticSearchName = ''; + this.links = []; } } diff --git a/src/app/services/organization.service.ts b/src/app/services/organization.service.ts index 954ed26edfeec27a01fc19c5b8d8e1483ebbe1c2..e94b9b151f4eaac9eb0766bdc3a7ee22cddb5947 100644 --- a/src/app/services/organization.service.ts +++ b/src/app/services/organization.service.ts @@ -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);