"use server";

import { prisma, Prisma, Heliport } from "@repo/db";

export const upsertHeliport = async (heliport: Prisma.HeliportCreateInput, id?: Heliport["id"]) => {
	const newHeliport = id
		? await prisma.heliport.update({
				where: { id: id },
				data: heliport,
			})
		: await prisma.heliport.create({ data: heliport });
	return newHeliport;
};

export const deleteHeliport = async (id: Heliport["id"]) => {
	await prisma.heliport.delete({ where: { id: id } });
};
