mirror of
https://github.com/ld3z/new-manga.git
synced 2026-11-09 19:23:49 -07:00
17 lines
No EOL
526 B
TypeScript
17 lines
No EOL
526 B
TypeScript
import type { APIRoute } from "astro";
|
|
import { validateSlugs } from "../../lib/api";
|
|
|
|
export const POST: APIRoute = async ({ request }) => {
|
|
try {
|
|
const { slugs } = await request.json();
|
|
const validSlugs = await validateSlugs(slugs);
|
|
|
|
return new Response(JSON.stringify({ validSlugs }), {
|
|
status: 200,
|
|
headers: { 'Content-Type': 'application/json' }
|
|
});
|
|
} catch (error) {
|
|
console.error('Validation error:', error);
|
|
return new Response("Validation failed", { status: 500 });
|
|
}
|
|
};
|