enzostvs's picture
enzostvs HF staff
fix dockerfile
1c0590e
raw
history blame
493 Bytes
import { json, type RequestEvent } from '@sveltejs/kit';
import prisma from '$lib/prisma';
/** @type {import('./$types').RequestHandler} */
export async function GET(request : RequestEvent) {
const repo = request.params.repo?.replace("@", "/")
const model = await prisma.model.findFirst({
where: {
repo
}
})
if (!model) {
return json({
error: {
token: "Model params is required"
}
}, { status: 401 })
}
return json({
model
})
}