Fix Prisma JSON typing in V1 actions
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { randomBytes } from "node:crypto";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { redirect } from "next/navigation";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { prisma } from "./prisma";
|
||||
import { requireCurrentUser, userIsAdmin } from "./session";
|
||||
|
||||
@@ -86,7 +87,7 @@ export async function revokeInvite(formData: FormData) {
|
||||
revalidateAdmin();
|
||||
}
|
||||
|
||||
async function audit(actorId: string, action: string, metadata: Record<string, unknown>) {
|
||||
async function audit(actorId: string, action: string, metadata: Prisma.InputJsonObject) {
|
||||
await prisma.auditEvent.create({ data: { actorId, action, metadata } });
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use server";
|
||||
|
||||
import { RoomVisibility } from "@prisma/client";
|
||||
import { Prisma, RoomVisibility } from "@prisma/client";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { redirect } from "next/navigation";
|
||||
import { prisma } from "./prisma";
|
||||
@@ -98,7 +98,7 @@ export async function resetPersonalRoom(formData: FormData) {
|
||||
await prisma.$transaction([
|
||||
prisma.mediaSource.deleteMany({ where: { roomId: room.id } }),
|
||||
prisma.roomMessage.deleteMany({ where: { roomId: room.id } }),
|
||||
prisma.room.update({ where: { id: room.id }, data: { currentState: null } }),
|
||||
prisma.room.update({ where: { id: room.id }, data: { currentState: Prisma.JsonNull } }),
|
||||
prisma.auditEvent.create({
|
||||
data: {
|
||||
actorId: user.id,
|
||||
|
||||
Reference in New Issue
Block a user