Skip to content

Commit

Permalink
add patch method
Browse files Browse the repository at this point in the history
  • Loading branch information
jessedp committed Nov 26, 2022
1 parent 590fa57 commit f1ed33a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,20 @@ export default class Tablo {
}
});
}

async patch<T>(path: string, patchData: any): Promise<T[]> {
this.isReady();
return new Promise(async (resolve, reject) => {
try {
const url = this.getUrl(path);
const returned: { data: T[] } = await Axios.patch(url, patchData);
const { data } = returned;
resolve(data);
} catch (error) {
reject(error);
}
});
}
}

export { Tablo };

0 comments on commit f1ed33a

Please sign in to comment.