game system nav context
sse endpoint
This commit is contained in:
@@ -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">
|
||||
|
@@ -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";
|
||||
|
@@ -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";
|
||||
|
||||
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user