continue Event page

This commit is contained in:
PxlLoewe
2025-02-17 10:39:29 +01:00
parent 8928455c3a
commit 30af30bd1d
13 changed files with 242 additions and 227 deletions

View File

@@ -1,20 +1,20 @@
'use server';
import { prisma, Prisma, Station } from '@repo/db';
import { prisma, Prisma, Event } from '@repo/db';
export const upsertStation = async (
station: Prisma.StationCreateInput,
id?: Station['id']
export const upsertEvent = async (
event: Prisma.EventCreateInput,
id?: Event['id']
) => {
const newStation = id
? await prisma.station.update({
const newEvent = id
? await prisma.event.update({
where: { id: id },
data: station,
data: event,
})
: await prisma.station.create({ data: station });
return newStation;
: await prisma.event.create({ data: event });
return newEvent;
};
export const deleteStation = async (id: Station['id']) => {
await prisma.station.delete({ where: { id: id } });
export const deleteEvent = async (id: Event['id']) => {
await prisma.event.delete({ where: { id: id } });
};