Skip to content

Commit

Permalink
fix(deal/task/ticket): fix real-time issue while clicks "Archive all …
Browse files Browse the repository at this point in the history
…carts in this list"

Closes #2629
  • Loading branch information
munkhjin0223 committed Feb 9, 2021
1 parent 0e3383b commit 332804e
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions api/src/data/resolvers/mutations/boardUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,28 +570,29 @@ export const itemsArchive = async (
{ $set: { status: BOARD_STATUSES.ARCHIVED } }
);

// order notification
const stage = await Stages.getStage(stageId);

for (const item of items) {
await ActivityLogs.createArchiveLog({
item,
contentType: type,
action: 'archived',
userId: user._id
});
}

// order notification
const stage = await Stages.getStage(stageId);

graphqlPubsub.publish('pipelinesChanged', {
pipelinesChanged: {
_id: stage.pipelineId,
proccessId,
action: 'itemsRemove',
data: {
destinationStageId: stage._id
graphqlPubsub.publish('pipelinesChanged', {
pipelinesChanged: {
_id: stage.pipelineId,
proccessId,
action: 'itemsRemove',
data: {
item,
destinationStageId: stage._id
}
}
}
});
});
}

return 'ok';
};

0 comments on commit 332804e

Please sign in to comment.