This commit is contained in:
Polaris
2024-07-23 16:15:27 -04:00
parent 4bfce2e630
commit c765df7662
6 changed files with 190 additions and 221 deletions

View File

@ -0,0 +1,33 @@
"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 getAllAvatarParts(category: number) {
const { user } = await getAuth();
if (!user || !user.accessCode) {
throw new Error("User is not authenticated or accessCode is missing");
}
const avatarParts = await artemis.chuni_static_avatar.findMany({
where: {
category: category
},
select: {
id: true,
name: true,
avatarAccessoryId: true,
category: true,
version: true,
iconPath: true,
texturePath: true,
}
});
return avatarParts;
}

View File

@ -1,8 +1,8 @@
import { DataTable } from "./data-table";
import { getSongsWithTitles } from "@/lib/api";
import { getAuth } from "@/auth/queries/getauth";
import { z } from "zod";
import { columns } from "./colums";
import { getSongsWithTitles } from "@/app/(sharing)/[token]/[id]/actions";
const userSchema = z.object({
UserId: z.number(),