Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 487 Bytes
1c0590e eb29a95 1c0590e eb29a95 1c0590e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import { json, type RequestEvent } from '@sveltejs/kit';
import prisma from '$lib/prisma';
/** @type {import('./$types').RequestHandler} */
export async function GET(request : RequestEvent) {
const id = request.params.id?.replace("@", "/")
const model = await prisma.model.findFirst({
where: {
id
}
})
if (!model) {
return json({
error: {
token: "Model params is required"
}
}, { status: 401 })
}
return json({
model
})
}
|