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);
};