mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Keep each copied comment's original author and timestamps, re-home it without mutating the cached source, and avoid generating false new-comment activity. Add positive, negative, wiring, and REST browser regressions. Thanks to ocdtrekkie, 2martens, frmwrk123 and xet7 ! Fixes #1213,
11 lines
284 B
JavaScript
11 lines
284 B
JavaScript
'use strict';
|
|
|
|
function buildCopiedComment(comment, newCardId, newBoardId) {
|
|
if (!comment || !newCardId || !newBoardId) return null;
|
|
const copy = { ...comment, cardId: newCardId, boardId: newBoardId };
|
|
delete copy._id;
|
|
return copy;
|
|
}
|
|
|
|
module.exports = { buildCopiedComment };
|