Update plugins/antiban.js
Browse files- plugins/antiban.js +35 -1
plugins/antiban.js
CHANGED
@@ -249,7 +249,41 @@ AntibanRoutes.get("/api/v1/user/story/task", authenticateApiKey, apiLimiter, asy
|
|
249 |
}
|
250 |
}, 10000);
|
251 |
|
252 |
-
res.json({ message: "Download started", job_id });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
});
|
254 |
|
255 |
/**
|
|
|
249 |
}
|
250 |
}, 10000);
|
251 |
|
252 |
+
res.json({ message: "Download started", status: "processing", job_id });
|
253 |
+
});
|
254 |
+
|
255 |
+
/**
|
256 |
+
* @swagger
|
257 |
+
* /api/v1/user/story/task/{job_id}:
|
258 |
+
* delete:
|
259 |
+
* summary: Check Telegram User Story Delete Job ID
|
260 |
+
* tags: [User]
|
261 |
+
* parameters:
|
262 |
+
* - in: path
|
263 |
+
* name: job_id
|
264 |
+
* required: true
|
265 |
+
* description: Job ID to delete
|
266 |
+
* schema:
|
267 |
+
* type: string
|
268 |
+
* - in: header
|
269 |
+
* name: x-api-key
|
270 |
+
* required: true
|
271 |
+
* description: API key for authentication
|
272 |
+
* schema:
|
273 |
+
* type: string
|
274 |
+
* responses:
|
275 |
+
* 200:
|
276 |
+
* description: Returns job Has been deleted
|
277 |
+
*/
|
278 |
+
AntibanRoutes.delete("/api/v1/user/story/:job_id", authenticateApiKey, apiLimiter, async (req, res) => {
|
279 |
+
const { job_id } = req.params;
|
280 |
+
|
281 |
+
const deletedJob = await Job.findOneAndDelete({ job_id });
|
282 |
+
|
283 |
+
if (!deletedJob) {
|
284 |
+
return res.status(404).json({ error: "Job not found" });
|
285 |
+
}
|
286 |
+
res.json({ message: "Job deleted successfully", job_id });
|
287 |
});
|
288 |
|
289 |
/**
|