Merge pull request #5265 from gustavengstrom/master

Added archive option to  of Wekan API
This commit is contained in:
Lauri Ojansivu 2024-01-23 05:45:30 +08:00 committed by GitHub
commit e15611a0ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: {