HUUUGE dump of code, toast system in a svelte module, new reworked tailwing color palette, WIP cms, WIP API and probably much more that i forgot about.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { db } from '$lib/server/db';
|
||||
import { groups } from '$lib/server/db/schema';
|
||||
import type { RequestEvent } from '@sveltejs/kit';
|
||||
import { eq } from 'drizzle-orm';
|
||||
|
||||
export async function GET(event: RequestEvent): Promise<Response> {
|
||||
if (event.params.gid === undefined)
|
||||
return new Response(`Bad request - no gid specified`, { status: 400 });
|
||||
|
||||
const row = await db
|
||||
.select()
|
||||
.from(groups)
|
||||
.where(eq(groups.gid, Number(event.params.gid)))
|
||||
.limit(1);
|
||||
if (!row.length) {
|
||||
return new Response(`Group not found`, { status: 404 });
|
||||
}
|
||||
|
||||
return new Response(JSON.stringify(row), {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user