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,23 +0,0 @@
"use server";
import { auth } from "@/auth";
import { prisma } from "@/prisma/prismaClient";
import { isEmailVerified } from "@/util/isEmailVerified";
export const createGameSystem = async (name: string) => {
const session = await auth();
if (!session?.user?.id) return null;
if (!isEmailVerified(session.user.id)) return null;
const { id } = await prisma.gameSystem.create({
data: {
name,
authorId: session.user.id,
},
select: {
id: true,
},
});
return id;
};

View File

@@ -1,7 +0,0 @@
"use server";
import { prisma } from "@/prisma/prismaClient";
// DEV TOOL ONLY
export async function deleteAllGameSystems() {
await prisma.gameSystem.deleteMany();
}

View File

@@ -1,5 +1,5 @@
"use server";
import { signIn, signOut } from "@/auth";
import { auth, signIn, signOut } from "@/auth";
export const signInWithDiscord = async () => {
await signIn("discord");
@@ -10,3 +10,5 @@ export const signInWithCreds = async (formData: FormData) => {
};
export const signOutOfApp = () => signOut();
export const getSession = async () => await auth();