randydev commited on
Commit
0a7062a
·
1 Parent(s): 0f40458
Files changed (1) hide show
  1. index.js +12 -1
index.js CHANGED
@@ -351,7 +351,18 @@ app.get("/api/v1/apikey-banlist", async (req, res) => {
351
 
352
  try {
353
  const bannedKeys = await collection.find({ is_banned: true }).toArray();
354
- res.json({ bannedKeys });
 
 
 
 
 
 
 
 
 
 
 
355
  } catch (err) {
356
  res.status(500).json({ error: `Failed to fetch banned keys: ${err.message}` });
357
  }
 
351
 
352
  try {
353
  const bannedKeys = await collection.find({ is_banned: true }).toArray();
354
+ if (bannedKeys.length > 0) {
355
+ const bannedOwners = bannedKeys.map(key => key.owner);
356
+ res.json({
357
+ owners: bannedOwners,
358
+ is_banned: true
359
+ });
360
+ } else {
361
+ res.json({
362
+ owners: [],
363
+ is_banned: false
364
+ });
365
+ }
366
  } catch (err) {
367
  res.status(500).json({ error: `Failed to fetch banned keys: ${err.message}` });
368
  }