mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-db.git
synced 2026-09-21 16:52:02 -07:00
Fixing issue with post replies that were overwriting one another
This commit is contained in:
@@ -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' },
|
||||
|
||||
@@ -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}`)
|
||||
|
||||
Reference in New Issue
Block a user