mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-23 01:40:53 +02:00
fix: incorrect author uid saved in topic
This commit is contained in:
@@ -86,7 +86,7 @@ Notes.assertTopic = async (uid, id) => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const chain = Array.from(await Notes.getParentChain(uid, id));
|
const chain = Array.from(await Notes.getParentChain(uid, id));
|
||||||
const tid = chain[chain.length - 1].pid;
|
const { pid: tid, uid: authorId } = chain[chain.length - 1];
|
||||||
|
|
||||||
const members = await db.isSortedSetMembers(`tidRemote:${tid}:posts`, chain.map(p => p.pid));
|
const members = await db.isSortedSetMembers(`tidRemote:${tid}:posts`, chain.map(p => p.pid));
|
||||||
if (members.every(Boolean)) {
|
if (members.every(Boolean)) {
|
||||||
@@ -106,7 +106,7 @@ Notes.assertTopic = async (uid, id) => {
|
|||||||
await Promise.all([
|
await Promise.all([
|
||||||
db.setObject(`topicRemote:${tid}`, {
|
db.setObject(`topicRemote:${tid}`, {
|
||||||
tid,
|
tid,
|
||||||
uid,
|
uid: authorId,
|
||||||
cid: -1,
|
cid: -1,
|
||||||
mainPid: tid,
|
mainPid: tid,
|
||||||
title: 'TBD',
|
title: 'TBD',
|
||||||
|
|||||||
Reference in New Issue
Block a user