Fix Prisma JSON typing in V1 actions
All checks were successful
Release Dry Run / release-dry-run (push) Successful in 1m36s
Template Compliance / compliance (push) Successful in 5s
Build / build (push) Successful in 12m7s

This commit is contained in:
MrSphay
2026-05-15 23:45:32 +02:00
parent c1ac6e4142
commit e883f99664
2 changed files with 4 additions and 3 deletions

View File

@@ -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 } });
}

View File

@@ -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,