mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
feat: added PUT /api/v1/categories/:cid route
Deprecated admin.categories.update socket call Showing stack trace in console for errors, when in development mode
This commit is contained in:
@@ -11,3 +11,12 @@ Categories.create = async (req, res) => {
|
||||
const categoryObjs = await categories.getCategories([response.cid]);
|
||||
helpers.formatApiResponse(200, res, categoryObjs[0]);
|
||||
};
|
||||
|
||||
Categories.update = async (req, res) => {
|
||||
const payload = {};
|
||||
payload[req.params.cid] = req.body;
|
||||
|
||||
await categories.update(payload);
|
||||
const categoryObjs = await categories.getCategories([req.params.cid]);
|
||||
helpers.formatApiResponse(200, res, categoryObjs[0]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user