Adding events for auto reload on data updating.

This commit is contained in:
charles-gauthereau
2024-12-14 17:49:50 +01:00
parent f6852950c8
commit ffa03496bf
8 changed files with 188 additions and 2 deletions
+5
View File
@@ -1,6 +1,7 @@
import {NextResponse} from "next/server";
import {isUuidv4} from "@/utils/verify-uuid";
import {prisma} from "@/prisma";
import {eventEmitter} from "../../../events/route";
@@ -72,6 +73,10 @@ export async function POST(
message: true,
details: "Restoration successfully updated"
}
eventEmitter.emit('modification', { update: true });
return Response.json(response , {status: 200})