mirror of
https://github.com/wekan/wekan.git
synced 2025-12-28 21:28:49 +01:00
✨ edit custom field dropdown item
This commit is contained in:
parent
457977f954
commit
24035329b8
1 changed files with 37 additions and 0 deletions
|
|
@ -476,6 +476,43 @@ if (Meteor.isServer) {
|
|||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* @operation edit_custom_field_dropdown_item
|
||||
* @summary Update a Custom Field's dropdown item
|
||||
*
|
||||
* @param {string} name names of the custom field
|
||||
* @return_type {_id: string}
|
||||
*/
|
||||
JsonRoutes.add(
|
||||
'PUT',
|
||||
'/api/boards/:boardId/custom-fields/:customFieldId/dropdown-items/:dropdownItemId',
|
||||
(req, res) => {
|
||||
Authentication.checkUserId(req.userId);
|
||||
|
||||
if (req.body.hasOwnProperty('name')) {
|
||||
CustomFields.direct.update(
|
||||
{
|
||||
_id: req.params.customFieldId,
|
||||
'settings.dropdownItems._id': req.params.dropdownItemId,
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
'settings.dropdownItems.$': {
|
||||
_id: req.params.dropdownItemId,
|
||||
name: req.body.name,
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
data: { _id: req.params.customFieldId },
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* @operation delete_custom_field_dropdown_item
|
||||
* @summary Update a Custom Field's dropdown items
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue