mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-02-21 22:44:21 +01:00
fix: remove old userKeys when linking key
This commit is contained in:
@@ -39,7 +39,12 @@ const loginHandler = async (req, res) => {
|
||||
return res.status(400).json({ status: 'ERROR', reason: "Can only link up to 3 wallets" })
|
||||
|
||||
if (existingKeys.includes(key))
|
||||
return res.status(400).json({ status: 'ERROR', reason: "Wallet already linked" })
|
||||
return res.status(400).json({ status: 'ERROR', reason: "Wallet already linked" });
|
||||
|
||||
// Remove old linking for this key if existing
|
||||
await prisma.userKey.delete({
|
||||
where: { key }
|
||||
})
|
||||
|
||||
|
||||
await prisma.userKey.create({
|
||||
|
||||
Reference in New Issue
Block a user