From c18d7c56c1f787cb453e9a285a941cfabf37d66e Mon Sep 17 00:00:00 2001 From: James Collins Date: Fri, 17 Feb 2023 14:40:34 +1000 Subject: [PATCH] added put shortcut --- resources/js/helpers/api.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/js/helpers/api.ts b/resources/js/helpers/api.ts index ec4e6b7..e1b7bf0 100644 --- a/resources/js/helpers/api.ts +++ b/resources/js/helpers/api.ts @@ -183,6 +183,11 @@ export const api = { return await this.send(options); }, + put: async function (options: ApiOptions): Promise { + options.method = "PUT"; + return await this.send(options); + }, + delete: async function (options: ApiOptions): Promise { options.method = "DELETE"; return await this.send(options);