From 38391ce9d61c159557888fefa80e3405786fbdbc Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Wed, 3 Jun 2026 13:57:31 -0700 Subject: [PATCH] Fixing issue with post replies that were overwriting one another --- src/controllers/rest-api/level/crud-handlers.js | 2 +- util/postchild/get_post_children.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/rest-api/level/crud-handlers.js b/src/controllers/rest-api/level/crud-handlers.js index e91dede..7a4aabd 100644 --- a/src/controllers/rest-api/level/crud-handlers.js +++ b/src/controllers/rest-api/level/crud-handlers.js @@ -37,7 +37,7 @@ export function makeCrudHandlers ({ dbProp, keyParam, bodyIdField, bodyDataField export const ENTITY_CONFIG = [ { route: 'post', dbProp: 'postsDb', keyParam: 'txid', bodyIdField: 'txid', bodyDataField: 'postData' }, { route: 'postparent', dbProp: 'postParentsDb', keyParam: 'txid', bodyIdField: 'txid', bodyDataField: 'parentData' }, - { route: 'postchild', dbProp: 'postChildrenDb', keyParam: 'txid', bodyIdField: 'txid', bodyDataField: 'childData' }, + { route: 'postchild', dbProp: 'postChildrenDb', keyParam: 'key', bodyIdField: 'key', bodyDataField: 'childData' }, { route: 'like', dbProp: 'likesDb', keyParam: 'txid', bodyIdField: 'txid', bodyDataField: 'likeData' }, { route: 'name', dbProp: 'namesDb', keyParam: 'addr', bodyIdField: 'addr', bodyDataField: 'nameData' }, { route: 'profile', dbProp: 'profilesDb', keyParam: 'addr', bodyIdField: 'addr', bodyDataField: 'profileData' }, diff --git a/util/postchild/get_post_children.js b/util/postchild/get_post_children.js index cc9219b..e9b556e 100644 --- a/util/postchild/get_post_children.js +++ b/util/postchild/get_post_children.js @@ -18,9 +18,9 @@ async function getPostChildren () { try { let count = 0 - for await (const [txid, child] of postChildrenDb.iterator()) { + for await (const [key, child] of postChildrenDb.iterator()) { count++ - console.log(`${txid} = ${JSON.stringify(child, null, 2)}`) + console.log(`${key} = ${JSON.stringify(child, null, 2)}`) } console.log(`\nTotal post children: ${count}`)