mirror of
https://github.com/wekan/wekan.git
synced 2025-12-21 01:40:13 +01: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,
|
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, {
|
JsonRoutes.sendResult(res, {
|
||||||
code: 200,
|
code: 200,
|
||||||
data: {
|
data: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue