mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
21 lines
516 B
TypeScript
21 lines
516 B
TypeScript
import { createPublisher } from '$lib/utils/db/publisherUtils.js';
|
|
import type { Publishers } from '$db/schema';
|
|
|
|
type PublisherCreate = {
|
|
publisher: Publishers;
|
|
externalId: string;
|
|
};
|
|
|
|
export async function POST({ request, locals }) {
|
|
const data: PublisherCreate = await request.json();
|
|
console.log('data', data);
|
|
|
|
try {
|
|
return await createPublisher(locals, data.publisher, data.externalId);
|
|
} catch (e) {
|
|
console.error(e);
|
|
return new Response('Could not create publisher', {
|
|
status: 500,
|
|
});
|
|
}
|
|
}
|