cleanup
This commit is contained in:
33
components/avatarcustomization/actions.ts
Normal file
33
components/avatarcustomization/actions.ts
Normal 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;
|
||||
}
|
@ -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(),
|
||||
|
Reference in New Issue
Block a user