mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-16 21:40:23 +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);
|
||||
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user