randydev commited on
Commit
d0cb5c0
·
verified ·
1 Parent(s): e3b5c4d

Update plugins/alldownloader.js

Browse files
Files changed (1) hide show
  1. plugins/alldownloader.js +9 -10
plugins/alldownloader.js CHANGED
@@ -59,36 +59,34 @@ async function downloadMedia(media) {
59
 
60
  /**
61
  * @swagger
62
- * /api/v1/custom-dev/all-api:
63
  * get:
64
- * summary: CustomDevv api all
65
  * tags: [ALL-Dev]
66
  * parameters:
67
  * - in: query
68
  * name: UseEnd
69
  * required: true
70
- * description: null
71
  * schema:
72
  * type: string
73
- * parameters:
74
  * - in: query
75
  * name: params
76
  * required: true
77
- * description: null
78
  * schema:
79
  * type: string
80
- * parameters:
81
  * - in: query
82
  * name: q
83
  * required: true
84
- * description: null
85
  * schema:
86
  * type: string
87
  * responses:
88
  * 200:
89
  * description: Success
90
  * 400:
91
- * description: Bad Request (e.g., missing or invalid URL)
92
  * 401:
93
  * description: Unauthorized (e.g., missing or invalid API key)
94
  * 500:
@@ -100,9 +98,10 @@ AllDlRoutes.get('/api/v1/custom/endpoint', apiLimiter, async (req, res) => {
100
  const params = req.query.params;
101
  const search = req.query.q;
102
 
103
- if (!url && !params && !search) {
104
- return res.status(400).json({ error: "parameter is required." });
105
  }
 
106
  const results = await IzreCustom(url, params, search);
107
  res.json({ message: results });
108
  } catch (error) {
 
59
 
60
  /**
61
  * @swagger
62
+ * /api/v1/custom/endpoint:
63
  * get:
64
+ * summary: Custom API for Devs
65
  * tags: [ALL-Dev]
66
  * parameters:
67
  * - in: query
68
  * name: UseEnd
69
  * required: true
70
+ * description: The base URL to fetch data from
71
  * schema:
72
  * type: string
 
73
  * - in: query
74
  * name: params
75
  * required: true
76
+ * description: Additional parameters for the request
77
  * schema:
78
  * type: string
 
79
  * - in: query
80
  * name: q
81
  * required: true
82
+ * description: Search query
83
  * schema:
84
  * type: string
85
  * responses:
86
  * 200:
87
  * description: Success
88
  * 400:
89
+ * description: Bad Request (e.g., missing or invalid parameters)
90
  * 401:
91
  * description: Unauthorized (e.g., missing or invalid API key)
92
  * 500:
 
98
  const params = req.query.params;
99
  const search = req.query.q;
100
 
101
+ if (!url || !params || !search) {
102
+ return res.status(400).json({ error: "All parameters are required." });
103
  }
104
+
105
  const results = await IzreCustom(url, params, search);
106
  res.json({ message: results });
107
  } catch (error) {