mirror of
https://github.com/stronk-dev/RandomChad.git
synced 2025-07-05 02:35:08 +02:00
Actually delete
This commit is contained in:
parent
115a510999
commit
8574c53bf8
@ -89,7 +89,7 @@ exports.setAvatar = async function( req, res ) {
|
||||
|
||||
exports.resetAvatar = async function( req, res ) {
|
||||
|
||||
const chain = process.env.NODE_ENV == 'development' ? '0x4' : '0x1'
|
||||
// const chain = process.env.NODE_ENV == 'development' ? '0x4' : '0x1'
|
||||
const network = 'mainnet'
|
||||
// const chain = '0x1'
|
||||
|
||||
@ -117,6 +117,12 @@ exports.resetAvatar = async function( req, res ) {
|
||||
}
|
||||
const cachedJson = JSON.parse( jsonstring )
|
||||
|
||||
// Delete the address
|
||||
if( jsonstring.images[ address ] ) {
|
||||
delete jsonstring.images[ address ]
|
||||
delete jsonstring.ids[ address ]
|
||||
}
|
||||
|
||||
// Get items that have not been updated
|
||||
const tenSecondsAgo = Date.now() - ( 10 * 1000 )
|
||||
const shouldBeUpdated = await db.collection( `${ network }Validators` ).where( 'updated', '>', cachedJson.updated || tenSecondsAgo ).get().then( dataFromSnap )
|
||||
|
Loading…
x
Reference in New Issue
Block a user