continue Event page
This commit is contained in:
@@ -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 } });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user