TSK-404 Fix service url.

This commit is contained in:
Martin Rojas Miguel Angel 2018-04-03 08:33:18 +02:00 committed by Holger Hagen
parent 5864d70e0b
commit b04515ad58
3 changed files with 17 additions and 18 deletions

View File

@ -104,8 +104,7 @@ export class WorkbasketInformationComponent implements OnChanges, OnDestroy {
private postNewWorkbasket() {
this.addDateToWorkbasket();
this.workbasketService.createWorkbasket(this.workbasket._links.self.href,
this.workbasket)
this.workbasketService.createWorkbasket(this.workbasket)
.subscribe((workbasketUpdated: Workbasket) => {
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Workbasket ${workbasketUpdated.key} was created successfully`))
this.workbasket = workbasketUpdated;
@ -120,7 +119,8 @@ export class WorkbasketInformationComponent implements OnChanges, OnDestroy {
new SavingInformation(this.workbasket._links.accessItems.href, this.workbasket.workbasketId));
}
}, error => {
this.errorModalService.triggerError(new ErrorModel('There was an error creating a workbasket', error.error.message))
this.errorModalService.triggerError(new ErrorModel('There was an error creating a workbasket',
error.error ? error.error.message : error))
this.requestInProgress = false;
});
}

View File

@ -103,11 +103,9 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
if (!workbasketIdSelected && this.action === ACTION.CREATE) { // CREATE
this.workbasket = new Workbasket(undefined);
this.workbasket._links.self = this.workbasket._links.allWorkbasketUrl;
this.requestInProgress = false;
} else if (!workbasketIdSelected && this.action === ACTION.COPY) { // COPY
this.workbasket = { ...this.workbasketCopy };
this.workbasket._links.self = this.workbasket._links.allWorkbasketUrl;
this.workbasket.workbasketId = undefined;
this.requestInProgress = false;
}

View File

@ -81,9 +81,10 @@ export class WorkbasketService {
return this.httpClient.get<Workbasket>(`${environment.taskanaRestUrl}/v1/workbaskets/${id}`, this.httpOptions);
}
// POST
createWorkbasket(url: string, workbasket: Workbasket): Observable<Workbasket> {
createWorkbasket(workbasket: Workbasket): Observable<Workbasket> {
return this.httpClient
.post<Workbasket>(url, workbasket, this.httpOptions);
.post<Workbasket>(`${environment.taskanaRestUrl}/v1/workbaskets`, workbasket, this.httpOptions);
}
// PUT
updateWorkbasket(url: string, workbasket: Workbasket): Observable<Workbasket> {