added getavatarpart

This commit is contained in:
Polaris
2024-07-21 13:24:31 -04:00
parent 0375709c8f
commit f916143f15
4 changed files with 120 additions and 256 deletions

View File

@ -180,6 +180,31 @@ export async function getAllAimeCards() {
return aimeUser;
}
export async function getAvatarParts(avatarAccessoryId: 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: {
avatarAccessoryId: avatarAccessoryId,
},
select: {
name: true,
category: true,
version: true,
iconPath: true,
texturePath: true,
}
});
return avatarParts;
}
export async function verifyAimeCodeAgainstArtemis() {
const { user } = await getAuth();