Skip to content

Commit

Permalink
Adds removal endpoint for wait list resource
Browse files Browse the repository at this point in the history
  • Loading branch information
coconutcraig committed Nov 19, 2018
1 parent d926578 commit 87fe76b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/resources/wait-list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,12 @@ it('can update a clients wait list request', async () => {
});

it('can delete a clients wait list request', async () => {
//
const resource = new WaitList(mockAxios);

await resource
.belonging(1)
.remove(2);

expect(mockAxios.delete).toHaveBeenCalledTimes(1);
expect(mockAxios.delete).toHaveBeenCalledWith('clients/1/requests/2');
});
4 changes: 3 additions & 1 deletion src/resources/wait-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export default class WaitList implements WaitListResource {
}

public async remove(list: number | string): Promise<any> {
//
const { client } = this.parameters;

return await this.client.delete(`clients/${client}/requests/${list}`);
}

public seeking(service: number | string): this {
Expand Down

0 comments on commit 87fe76b

Please sign in to comment.