Skip to content

Commit

Permalink
SHIBUI-1031 Updated UI to use PATCH
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Jan 9, 2019
1 parent 64b6a11 commit 67e33cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ui/src/app/user/admin/service/admin.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ describe('Admin Service', () => {
)));
});
describe('update method', () => {
it(`should send an expected put request`, async(inject([AdminService, HttpTestingController],
it(`should send an expected patch request`, async(inject([AdminService, HttpTestingController],
(service: AdminService, backend: HttpTestingController) => {
service.update({...users[0]}).subscribe();

backend.expectOne((req: HttpRequest<any>) => {
return req.url === '/api/admin/users/abc'
&& req.method === 'PUT';
}, `PUT admin user`);
&& req.method === 'PATCH';
}, `PATCH admin user`);
}
)));
});
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/user/admin/service/admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class AdminService {
}

update(user: Admin): Observable<Admin> {
return this.http.put<Admin>(
return this.http.patch<Admin>(
`${this.base}${this.endpoint}/${user.username}`, {...user}
);
}
Expand Down

0 comments on commit 67e33cf

Please sign in to comment.