From f1ed33a319cd0bcd036047f30aca461bd27cbb75 Mon Sep 17 00:00:00 2001 From: jesse Date: Fri, 25 Nov 2022 21:53:06 -0500 Subject: [PATCH] add patch method --- src/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/index.ts b/src/index.ts index 72607d2..3e38140 100644 --- a/src/index.ts +++ b/src/index.ts @@ -192,6 +192,20 @@ export default class Tablo { } }); } + + async patch(path: string, patchData: any): Promise { + 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 };