not saving the first '/' of a stakeholder's URL alias
This commit is contained in:
parent
0561d945c5
commit
965b1ee134
|
@ -92,6 +92,9 @@ export class StakeholderService {
|
||||||
}
|
}
|
||||||
|
|
||||||
buildStakeholder(url: string, stakeholder: Stakeholder): Observable<Stakeholder> {
|
buildStakeholder(url: string, stakeholder: Stakeholder): Observable<Stakeholder> {
|
||||||
|
if(stakeholder.alias && stakeholder.alias.startsWith('/')) {
|
||||||
|
stakeholder.alias = stakeholder.alias.slice(1);
|
||||||
|
}
|
||||||
return this.http.post<Stakeholder>(url + '/build-stakeholder', stakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
return this.http.post<Stakeholder>(url + '/build-stakeholder', stakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
||||||
return this.formalize(this.checkIsUpload(stakeholder));
|
return this.formalize(this.checkIsUpload(stakeholder));
|
||||||
}));
|
}));
|
||||||
|
@ -102,6 +105,9 @@ export class StakeholderService {
|
||||||
}
|
}
|
||||||
|
|
||||||
saveElement(url: string, element: any, path: string[] = []): Observable<any> {
|
saveElement(url: string, element: any, path: string[] = []): Observable<any> {
|
||||||
|
if(element.alias && element.alias.startsWith('/')) {
|
||||||
|
element.alias = element.alias.slice(1);
|
||||||
|
}
|
||||||
path = HelperFunctions.encodeArray(path);
|
path = HelperFunctions.encodeArray(path);
|
||||||
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
|
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
|
||||||
'/save', element, CustomOptions.registryOptions()).pipe(map(element => {
|
'/save', element, CustomOptions.registryOptions()).pipe(map(element => {
|
||||||
|
|
Loading…
Reference in New Issue