addded nameplates

This commit is contained in:
Polaris
2024-07-26 14:08:36 -04:00
parent 5af3b9236b
commit ce82e860bd
5 changed files with 284 additions and 28 deletions

View File

@ -0,0 +1,47 @@
"use server";
import { getAuth } from "@/auth/queries/getauth";
import { artemis, daphnis } from "@/lib/prisma";
import type * as Prisma from "@prisma/client";
// type ChuniScorePlaylog = Prisma.PrismaClient;
// type ChuniStaticMusic = Prisma.PrismaClient;
export async function getCurrentNameplate() {
const { user } = await getAuth();
if (!user || !user.accessCode) {
throw new Error("User is not authenticated or accessCode is missing");
}
const nameplates = await artemis.chuni_profile_data.findMany({
where: {
user: user.UserId,
},
select: {
nameplateId: true,
},
});
return nameplates;
}
export async function getNamePlates() {
const { user } = await getAuth();
if (!user || !user.accessCode) {
throw new Error("User is not authenticated or accessCode is missing");
}
const nameplates = await artemis.cozynet_chuni_static_nameplate.findMany({
select: {
id: true,
str: true,
sortName: true,
category: true,
imagePath: true,
rareType: true,
netOpenName: true,
},
});
return nameplates;
}