Fix URL in account service.

This commit is contained in:
Alexis Lahouze 2017-07-14 10:05:48 +02:00
parent 3fb442ab5d
commit c6761e1379

View File

@ -26,7 +26,7 @@ export class AccountService {
}
get(id: number): Observable<Account> {
return this.http.get(this.url + '/' + id)
return this.http.get(this.url + id)
.catch((res: Response) => Observable.throw(res.json()))
.map((res: Response) => res.json());
}
@ -46,7 +46,7 @@ export class AccountService {
let options = new RequestOptions({ headers: headers });
let body = JSON.stringify(account);
return this.http.post(this.url + '/' + account.id, body, options)
return this.http.post(this.url + account.id, body, options)
.catch((res: Response) => Observable.throw(res.json()))
.map((res: Response) => res.json());
}
@ -55,7 +55,7 @@ export class AccountService {
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
return this.http.delete(this.url + '/' + account.id)
return this.http.delete(this.url + account.id)
.catch((res: Response) => Observable.throw(res.json()))
.map((res: Response) => res.json());
}