mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: update main post timestamp when rescheduling
This commit is contained in:
@@ -60,6 +60,7 @@ Scheduled.pin = async function (tid, topicData) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Scheduled.reschedule = async function ({ cid, tid, timestamp, uid }) {
|
Scheduled.reschedule = async function ({ cid, tid, timestamp, uid }) {
|
||||||
|
const mainPid = await topics.getTopicField(tid, 'mainPid');
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
db.sortedSetsAdd([
|
db.sortedSetsAdd([
|
||||||
'topics:scheduled',
|
'topics:scheduled',
|
||||||
@@ -67,6 +68,7 @@ Scheduled.reschedule = async function ({ cid, tid, timestamp, uid }) {
|
|||||||
'topics:tid',
|
'topics:tid',
|
||||||
`cid:${cid}:uid:${uid}:tids`,
|
`cid:${cid}:uid:${uid}:tids`,
|
||||||
], timestamp, tid),
|
], timestamp, tid),
|
||||||
|
posts.setPostField(mainPid, 'timestamp', timestamp),
|
||||||
shiftPostTimes(tid, timestamp),
|
shiftPostTimes(tid, timestamp),
|
||||||
]);
|
]);
|
||||||
return topics.updateLastPostTimeFromLastPid(tid);
|
return topics.updateLastPostTimeFromLastPid(tid);
|
||||||
|
|||||||
Reference in New Issue
Block a user