Dienstellen Selektion raus aus Admin

This commit is contained in:
titver968
2025-04-17 14:17:12 +02:00
parent cc94a6dda2
commit 06693cf59a
3 changed files with 11 additions and 1 deletions

Binary file not shown.

View File

@@ -23,7 +23,7 @@
let dienststellen: any[]; let dienststellen: any[];
onMount(async () => { onMount(async () => {
const res = await fetch('/api/admin/dienststellen'); const res = await fetch('/api/dienststellen');
dienststellen = await res.json(); dienststellen = await res.json();
}); });

View File

@@ -0,0 +1,10 @@
import { PrismaClient } from '@prisma/client';
import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
const prisma = new PrismaClient();
export const GET: RequestHandler = async () => {
const dienststellen = await prisma.dienststelle.findMany({ orderBy: { name: 'asc' } });
return json(dienststellen);
};