mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Added archive option to of Wekan API
This commit is contained in:
parent
80e5916394
commit
f5bc2b08f9
1 changed files with 19 additions and 0 deletions
|
@ -3860,6 +3860,25 @@ JsonRoutes.add('GET', '/api/boards/:boardId/cards_count', function(
|
|||
newBoardId,
|
||||
);
|
||||
}
|
||||
if (req.body.archive) {
|
||||
function isTrue(data) {
|
||||
return String(data).toLowerCase() === 'true';
|
||||
}
|
||||
var archive = isTrue(req.body.archive);
|
||||
Cards.direct.update(
|
||||
{
|
||||
_id: paramCardId,
|
||||
listId: paramListId,
|
||||
boardId: paramBoardId,
|
||||
archived: !archive,
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
archived: archive,
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
data: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue