update
Browse files
index.js
CHANGED
@@ -376,13 +376,13 @@ app.post("/api/v1/api-key-ban", async (req, res) => {
|
|
376 |
{ upsert: false }
|
377 |
);
|
378 |
|
379 |
-
if (result.
|
380 |
res.json({
|
381 |
message: "API key successfully banned",
|
382 |
owner: userIdNumber
|
383 |
});
|
384 |
} else {
|
385 |
-
res.status(500).json({ error:
|
386 |
}
|
387 |
|
388 |
} catch (err) {
|
|
|
376 |
{ upsert: false }
|
377 |
);
|
378 |
|
379 |
+
if (result.matchedCount > 0) {
|
380 |
res.json({
|
381 |
message: "API key successfully banned",
|
382 |
owner: userIdNumber
|
383 |
});
|
384 |
} else {
|
385 |
+
res.status(500).json({ error: "Failed to ban API key" });
|
386 |
}
|
387 |
|
388 |
} catch (err) {
|