game system nav context

sse endpoint
This commit is contained in:
2024-09-08 06:43:39 -06:00
parent 84cbea8ce1
commit a2fde9cc79
12 changed files with 37 additions and 89 deletions

View File

@@ -1,3 +1,6 @@
// import { setCurrentGameSystem } from "@/actions/GameSystems/client";
import { setCurrentGameSystem } from "@/actions/GameSystems/client";
import { auth } from "@/auth";
import { prisma } from "@/prisma/prismaClient";
import Link from "next/link";
@@ -32,6 +35,10 @@ export default async function GameSystem({
// },
});
const session = await auth();
session?.user?.id && (await setCurrentGameSystem(session.user.id, id));
return (
<>
<section className="heading">

View File

@@ -1,6 +1,6 @@
"use client";
import { deleteAllGameSystems } from "@/actions/GameSystems/deleteAll";
import { deleteAllGameSystems } from "@/actions/GameSystems/devactions";
import { DevTool } from "@/components/devtools/DevTool";
import { useRouter } from "next/navigation";
import { FC, PropsWithChildren } from "react";

View File

@@ -1,5 +1,5 @@
"use client";
import { createGameSystem } from "@/actions/GameSystems/create";
import { createGameSystem } from "@/actions/GameSystems";
import { useToast } from "@/components/toast";
import { redirect } from "next/navigation";

View File

@@ -2,8 +2,12 @@ import { prisma } from "@/prisma/prismaClient";
import CreateGameSystem from "./create";
import { GameSystemsClient } from "./client";
import Link from "next/link";
import { setCurrentGameSystem } from "@/actions/GameSystems/client";
import { auth } from "@/auth";
export default async function GameSystems() {
const session = await auth();
session?.user?.id && (await setCurrentGameSystem(session.user.id));
const existingGameSystems = await prisma.gameSystem.findMany({
orderBy: {
created: "asc",