mirror of
https://github.com/ld3z/new-manga.git
synced 2026-11-09 20:23:45 -07:00
add better feed handling
This commit is contained in:
parent
b8499d90c6
commit
0daac66b26
4 changed files with 252 additions and 183 deletions
17
src/pages/api/validate-slugs.ts
Normal file
17
src/pages/api/validate-slugs.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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 });
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue