feat: add support for PATCH method in api module

This commit is contained in:
Julian Lam
2022-03-14 17:22:09 -04:00
parent b10df78141
commit 4b79dfd29d

View File

@@ -65,6 +65,16 @@ define('api', ['hooks'], (hooks) => {
},
}, onSuccess);
api.patch = (route, payload, onSuccess) => call({
url: route,
method: 'patch',
data: JSON.stringify(payload || {}),
contentType: 'application/json; charset=utf-8',
headers: {
'x-csrf-token': config.csrf_token,
},
}, onSuccess);
api.put = (route, payload, onSuccess) => call({
url: route,
method: 'put',