added chunithm version selector in admin settings
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
"use server";
|
||||
|
||||
import { getAuth } from "@/auth/queries/getauth";
|
||||
import { supportedVersionNumber } from "@/lib/helpers";
|
||||
import { getSupportedVersionNumber } from "@/lib/api";
|
||||
import { artemis } from "@/lib/prisma";
|
||||
|
||||
export async function getCurrentTrophies() {
|
||||
const { user } = await getAuth();
|
||||
const supportedVersionNumber = await getSupportedVersionNumber();
|
||||
|
||||
if (!user || !user.accessCode) {
|
||||
throw new Error("User is not authenticated or accessCode is missing");
|
||||
@ -25,6 +26,7 @@ export async function getCurrentTrophies() {
|
||||
|
||||
export async function updatePlayerTrophy(trophyId: number) {
|
||||
const { user } = await getAuth();
|
||||
const supportedVersionNumber = await getSupportedVersionNumber();
|
||||
|
||||
if (!user || !user.accessCode) {
|
||||
throw new Error("User is not authenticated or accessCode is missing");
|
||||
|
@ -76,8 +76,8 @@ export const TrophyCustomization: FC<AvatarSelectionProps> = ({
|
||||
}, []);
|
||||
|
||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
||||
const unchangedNamePlateId = trophyID;
|
||||
const newNamePlateId = data.trophies ?? unchangedNamePlateId;
|
||||
const defaultNamePlateId = trophyID;
|
||||
const newNamePlateId = data.trophies ?? defaultNamePlateId;
|
||||
|
||||
updatePlayerTrophy(newNamePlateId).then(() => {
|
||||
setTrophyId(newNamePlateId);
|
||||
@ -112,7 +112,7 @@ export const TrophyCustomization: FC<AvatarSelectionProps> = ({
|
||||
name="trophies"
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex flex-col">
|
||||
<FormLabel>Select Trophy</FormLabel>
|
||||
<FormLabel className="pb-2">Select Trophy</FormLabel>
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<FormControl>
|
||||
|
Reference in New Issue
Block a user