Error boundary

This commit is contained in:
PxlLoewe
2025-03-26 14:04:15 -07:00
parent 9551202370
commit c8d91b684f
21 changed files with 414 additions and 298 deletions

View File

@@ -1,20 +1,20 @@
"use server";
import { prisma, Prisma, Station } from "@repo/db";
import { prisma, Prisma, Keyword } from "@repo/db";
export const upsertKeyword = async (
station: Prisma.StationCreateInput,
id?: Station["id"],
keyword: Prisma.KeywordCreateInput,
id?: Keyword["id"],
) => {
const newStation = id
? await prisma.station.update({
const newKeyword = id
? await prisma.keyword.update({
where: { id: id },
data: station,
data: keyword,
})
: await prisma.station.create({ data: station });
return newStation;
: await prisma.keyword.create({ data: keyword });
return newKeyword;
};
export const deleteStation = async (id: Station["id"]) => {
await prisma.station.delete({ where: { id: id } });
export const deleteKeyword = async (id: Keyword["id"]) => {
await prisma.keyword.delete({ where: { id: id } });
};