Skip to content

Commit

Permalink
fix: delete method rename to math del request
Browse files Browse the repository at this point in the history
  • Loading branch information
gerard2perez committed Apr 26, 2018
1 parent 796b943 commit c349c52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Linode v4 API
#### Date compatibility 2018-04-02
#### Date compatibility 2018-04-23

This is a promise-based clinet for the [Linode API](https://developers.linode.com/v4/introduction) version 4

Expand Down
6 changes: 2 additions & 4 deletions src/extended-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ function ClientMethod(target:ExtendedClient, key:string, descriptor:PropertyDesc
descriptor.value = function (route:string, data?:any, filter?:any) {
const parent:any = this;
return new Promise<any>(function(resolve) {
// istanbul ignore next
let mth = key === 'delete' ? 'del' : key;
parent.client[mth](...parent.prepare(route, data, filter), (json:any) => {
parent.client[key](...parent.prepare(route, data, filter), (json:any) => {
resolve(json);
});
});
Expand Down Expand Up @@ -52,5 +50,5 @@ export class ExtendedClient {
// istanbul ignore next
@ClientMethod async put(url:string, data:any) : Promise<any> {};
// istanbul ignore next
@ClientMethod async delete(url:string) : Promise<any> {};
@ClientMethod async del(url:string) : Promise<any> {};
}

0 comments on commit c349c52

Please sign in to comment.