diff --git a/src/handlers/implants.ts b/src/handlers/implants.ts index 9a12f5be22841dacd9b6052da4f61dfac5088641..0ce43923910cad100781848b29615f1e3e5fae25 100644 --- a/src/handlers/implants.ts +++ b/src/handlers/implants.ts @@ -135,7 +135,7 @@ export default class implant{ return res.status(404).json({ error: "User or implant not found" }); const bought = await db.select().from(purchasesTable).where(eq(purchasesTable.implant_id, product_id)) - if (bought) + if (bought.length > 0) return res.status(404).json({ error: "Implant was already bought" }); var userMoney = parseFloat(user.money);