Fixing issue with post replies that were overwriting one another

This commit is contained in:
Chris Troutner
2026-06-03 13:57:31 -07:00
parent d885ffcd26
commit 38391ce9d6
2 changed files with 3 additions and 3 deletions
@@ -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' },
+2 -2
View File
@@ -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}`)