feat: Add maxItems validation to jobIds array and improve API response error handling.

This commit is contained in:
Namit2003 2025-12-17 19:08:44 -05:00
parent 8b6c64bff7
commit a00597440f
2 changed files with 5 additions and 1 deletions

View file

@ -109,7 +109,7 @@ export const deleteJob = new Elysia()
{ {
auth: true, auth: true,
body: t.Object({ body: t.Object({
jobIds: t.Array(t.String()), jobIds: t.Array(t.String(), { maxItems: 100 }),
}), }),
}, },
); );

View file

@ -300,6 +300,10 @@ export const history = new Elysia().use(userService).get(
body: JSON.stringify({ jobIds }), body: JSON.stringify({ jobIds }),
}); });
if (!response.ok) {
throw new Error(\`HTTP error! status: \${response.status}\`);
}
const result = await response.json(); const result = await response.json();
if (result.success || result.deleted > 0) { if (result.success || result.deleted > 0) {