rename feed.getRoot() to feed.getId()

This commit is contained in:
Andre Staltz 2023-05-26 14:24:39 +03:00
parent 0772aa4883
commit 90395b8bd3
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 3 additions and 3 deletions

View File

@ -225,7 +225,7 @@ exports.init = function initDB(peer, config) {
const keys = opts.keys ?? config.keys
const { group, type } = opts
const feedRootHash = getFeedRoot(group, type)
const feedRootHash = getFeedId(group, type)
if (feedRootHash) return cb(null, feedRootHash)
const feedRoot = MsgV2.createRoot(group, type, keys)
@ -354,7 +354,7 @@ exports.init = function initDB(peer, config) {
})
}
function getFeedRoot(groupId, findType) {
function getFeedId(groupId, findType) {
const findGroup = MsgV2.stripGroup(groupId)
for (const rec of records()) {
if (MsgV2.isFeedRoot(rec.msg, findGroup, findType)) return rec.hash
@ -429,7 +429,7 @@ exports.init = function initDB(peer, config) {
},
feed: {
publish: publishToFeed,
getRoot: getFeedRoot,
getId: getFeedId,
},
getRecord,
get,