mirror of https://codeberg.org/pzp/pzp-db.git
fixup for: change ghosts.add API arguments
This commit is contained in:
parent
31bf38e2d2
commit
8c3800264a
|
@ -941,9 +941,9 @@ function initDB(peer, config) {
|
|||
function addGhost(opts, cb) {
|
||||
if (!opts) return cb(new Error('ghosts.add() requires an `opts`'))
|
||||
// prettier-ignore
|
||||
if (!opts.tangleID || typeof opts.tangleID !== 'string') return cb(new Error('ghosts.add() requires tangleID for the deleted msg in `opts.tangle`'))
|
||||
if (!opts.tangleID || typeof opts.tangleID !== 'string') return cb(new Error('ghosts.add() requires tangleID for the deleted msg in `opts.tangleID`'))
|
||||
// prettier-ignore
|
||||
if (!opts.msgID || typeof opts.msgID !== 'string') return cb(new Error('ghosts.add() requires msgID of the deleted msg in `opts.msg`'))
|
||||
if (!opts.msgID || typeof opts.msgID !== 'string') return cb(new Error('ghosts.add() requires msgID of the deleted msg in `opts.msgID`'))
|
||||
// prettier-ignore
|
||||
if (!opts.max || typeof opts.max !== 'number') return cb(new Error('ghosts.add() requires max depth distance in `opts.max`'))
|
||||
const { tangleID, msgID, max } = opts
|
||||
|
@ -952,7 +952,7 @@ function initDB(peer, config) {
|
|||
if (!rec.msg) return cb()
|
||||
const tangleData = rec.msg.metadata.tangles[tangleID]
|
||||
// prettier-ignore
|
||||
if (!tangleData) return cb(new Error(`ghosts.add() opts.msg "${opts.msg}" does not belong to opts.tangle "${opts.tangle}"`))
|
||||
if (!tangleData) return cb(new Error(`ghosts.add() opts.msg "${opts.msgID}" does not belong to opts.tangle "${opts.tangleID}"`))
|
||||
const depth = tangleData.depth
|
||||
|
||||
ghosts.save(tangleID, msgID, depth, max, (err) => {
|
||||
|
|
Loading…
Reference in New Issue