Skip to content

Commit

Permalink
Merge pull request #233 from kodadot/hotfix/delete-TokenEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival authored Mar 7, 2024
2 parents 29bcdf2 + d1773b1 commit 486b765
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mappings/shared/token/tokenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ export class TokenAPI {

if (updatedCount === 0) {
debug(OPERATION, { deleteEmptyToken: `delete empty token ${token.id}` })

await emOf(this.store).delete(TE, token.id)
try {
await emOf(this.store).delete(TE, token.id)
} catch (error) {
debug(OPERATION, {
deleteEmptyToken: `Failed to delete token ${token.id}`,
error,
})
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/mappings/shared/token/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ export const tokenName = (nftName: string | undefined | null, collectionId: stri

return doNotAlter ? nftName : nftName.replace(/([#_]\d+$)/g, '')
}

0 comments on commit 486b765

Please sign in to comment.