From 38e72893ddd7fcef4b3bb6c5dcf606eaee9eef78 Mon Sep 17 00:00:00 2001 From: Mats Andreassen Date: Sun, 6 Dec 2020 20:37:35 +0100 Subject: [PATCH] Added apiDelete method --- README.md | 7 ++++++- src/lib/auth-provider.js | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae7b4de..32c4849 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,12 @@ const App = () => {
  • url (string) (required)
  • data (required) - +- `apiDelete` (function) - deletes data from provided URL using the users id_token +
    + Parameters +
      +
    • url (string) (required)
    • +
    #### User object diff --git a/src/lib/auth-provider.js b/src/lib/auth-provider.js index ec33d95..d6b1817 100644 --- a/src/lib/auth-provider.js +++ b/src/lib/auth-provider.js @@ -258,6 +258,7 @@ export const MsalProvider = ({ const apiGet = url => retry(() => axios.get(url)) const apiPost = (url, payload) => retry(() => axios.post(url, payload)) const apiPut = (url, payload) => retry(() => axios.put(url, payload)) + const apiDelete = url => retry(() => axios.delete(url)) return ( {children}