Sticky headers fix, added Heliports
This commit is contained in:
17
apps/hub/app/(app)/admin/heliport/action.ts
Normal file
17
apps/hub/app/(app)/admin/heliport/action.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
"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 } });
|
||||
};
|
||||
Reference in New Issue
Block a user