mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 05:50:25 +01:00
feat: add support for PATCH method in api module
This commit is contained in:
@@ -65,6 +65,16 @@ define('api', ['hooks'], (hooks) => {
|
|||||||
},
|
},
|
||||||
}, onSuccess);
|
}, 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({
|
api.put = (route, payload, onSuccess) => call({
|
||||||
url: route,
|
url: route,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
|||||||
Reference in New Issue
Block a user