Files
wekan/models/lib/copiedComment.js
T

12 lines
388 B
JavaScript

'use strict';
const { withoutCommentPrivateFields } = require('./commentPrivateFields');
function buildCopiedComment(comment, newCardId, newBoardId) {
if (!comment || !newCardId || !newBoardId) return null;
const copy = { ...withoutCommentPrivateFields(comment), cardId: newCardId, boardId: newBoardId };
delete copy._id;
return copy;
}
module.exports = { buildCopiedComment };