From 1471bd3de4e2fac32bd751cdb1cff628999e9a07 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 8 Feb 2023 05:08:25 +0000 Subject: quiet socket errors --- routes/payments.js | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'routes/payments.js') diff --git a/routes/payments.js b/routes/payments.js index ec557474..a11934ea 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -242,20 +242,4 @@ export default { res.send({ txid }); }, - - async del({ params: { username }, headers: { authorization } }, res) { - if (!authorization.includes(config.admin)) - return res.code(401).send("unauthorized"); - let { id, pubkey } = await g(`user:${await g(`user:${username}`)}`); - let invoices = await db.lRange(`${id}:invoices`, 0, -1); - let payments = await db.lRange(`${id}:payments`, 0, -1); - - for (let { id } of invoices) db.del(`invoice:${id}`); - for (let { id } of payments) db.del(`payment:${id}`); - db.del(`user:${username}`); - db.del(`user:${id}`); - db.del(`user:${pubkey}`); - - res.send({}); - } }; -- cgit v1.2.3