mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
19 lines
540 B
TypeScript
19 lines
540 B
TypeScript
import type { Publishers } from '$db/schema'
|
|
import { getPublisher, updatePublisher } from '$lib/utils/db/publisherUtils.js'
|
|
|
|
export async function GET({ locals, params }) {
|
|
try {
|
|
return await getPublisher(locals, params.id)
|
|
} catch (e) {
|
|
console.error(e)
|
|
return new Response('Could not get publishersTable', {
|
|
status: 500,
|
|
})
|
|
}
|
|
}
|
|
|
|
export async function PUT({ locals, params, request }) {
|
|
const data: Publishers = await request.json()
|
|
const publisherId = params.id
|
|
return await updatePublisher(locals, data, publisherId)
|
|
}
|