20 lines
406 B
TypeScript
20 lines
406 B
TypeScript
"use server";
|
|
import { Prisma, prisma } from "@repo/db";
|
|
|
|
export const editReport = async (id: number, data: Prisma.ReportUncheckedUpdateInput) => {
|
|
return await prisma.report.update({
|
|
where: {
|
|
id: id,
|
|
},
|
|
data,
|
|
});
|
|
};
|
|
|
|
export const createReport = async (
|
|
data: Prisma.XOR<Prisma.ReportCreateInput, Prisma.ReportUncheckedCreateInput>,
|
|
) => {
|
|
return await prisma.report.create({
|
|
data,
|
|
});
|
|
};
|