Skip to content

Commit

Permalink
refactor: revalidate path
Browse files Browse the repository at this point in the history
  • Loading branch information
ItaloMedici committed Aug 27, 2024
1 parent a25bf7d commit e94fbc5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/api/[roomId]/board/reveal/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { toggleRevealBoard } from "@/use-cases/board/revel-board";
import { revalidatePath } from "next/cache";

export async function POST(
_: Request,
Expand All @@ -13,6 +14,8 @@ export async function POST(

await toggleRevealBoard({ roomId });

revalidatePath(`/room/${roomId}`);

return Response.json({ message: "Board updated" });
} catch (error: any) {
console.error(error);
Expand Down

0 comments on commit e94fbc5

Please sign in to comment.