diff options
Diffstat (limited to 'src/app/api.service.ts')
-rw-r--r-- | src/app/api.service.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/app/api.service.ts b/src/app/api.service.ts index b659198..6597514 100644 --- a/src/app/api.service.ts +++ b/src/app/api.service.ts | |||
@@ -62,7 +62,7 @@ export class ApiService { | |||
62 | 62 | ||
63 | deleteIdentity (id: string): Observable<any>{ | 63 | deleteIdentity (id: string): Observable<any>{ |
64 | this.messages.dismissError(); | 64 | this.messages.dismissError(); |
65 | return this.http.delete(this.identityURL+'/'+id) | 65 | return this.http.delete(this.identityURL+'?pubkey='+id) |
66 | .pipe( | 66 | .pipe( |
67 | tap(json => this.handleJSON(json)), | 67 | tap(json => this.handleJSON(json)), |
68 | catchError(this.handleError('deleteIdentity', [])) | 68 | catchError(this.handleError('deleteIdentity', [])) |
@@ -70,10 +70,20 @@ export class ApiService { | |||
70 | } | 70 | } |
71 | 71 | ||
72 | 72 | ||
73 | changeIdentity (id: string, json: any): Observable<any>{ | 73 | changeIdentity (json: any): Observable<any>{ |
74 | this.messages.dismissError(); | 74 | this.messages.dismissError(); |
75 | const options = {headers: {'Content-Type': 'application/json'}}; | 75 | const options = {headers: {'Content-Type': 'application/json'}}; |
76 | return this.http.put(this.identityURL+'/'+id, json, options) | 76 | return this.http.put(this.identityURL, json, options) |
77 | .pipe( | ||
78 | tap(json => this.handleJSON(json)), | ||
79 | catchError(this.handleError('changeIdentity', [])) | ||
80 | ); | ||
81 | } | ||
82 | |||
83 | assignIdentity (json: any): Observable<any>{ | ||
84 | this.messages.dismissError(); | ||
85 | const options = {headers: {'Content-Type': 'application/json'}}; | ||
86 | return this.http.put(this.identityURL, json, options) | ||
77 | .pipe( | 87 | .pipe( |
78 | tap(json => this.handleJSON(json)), | 88 | tap(json => this.handleJSON(json)), |
79 | catchError(this.handleError('changeIdentity', [])) | 89 | catchError(this.handleError('changeIdentity', [])) |