mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 15:49:46 +02:00
feat: Persist closed state per card
This commit is contained in:
parent
69c75a03b1
commit
709a0d1758
19 changed files with 163 additions and 71 deletions
|
@ -33,6 +33,28 @@ module.exports = {
|
|||
async fn(inputs) {
|
||||
const { values } = inputs;
|
||||
|
||||
if (values.type) {
|
||||
let isClosed;
|
||||
if (values.type === List.Types.CLOSED) {
|
||||
if (inputs.record.type === List.Types.ACTIVE) {
|
||||
isClosed = true;
|
||||
}
|
||||
} else if (inputs.record.type === List.Types.CLOSED) {
|
||||
isClosed = false;
|
||||
}
|
||||
|
||||
if (!_.isUndefined(isClosed)) {
|
||||
await Card.qm.update(
|
||||
{
|
||||
listId: inputs.record.id,
|
||||
},
|
||||
{
|
||||
isClosed,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!_.isUndefined(values.position)) {
|
||||
const lists = await sails.helpers.boards.getFiniteListsById(
|
||||
inputs.board.id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue