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 getCurrentNameplate() {
|
||||
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 getCurrentNameplate() {
|
||||
|
||||
export async function updatePlayerNamePlate(nameplateId?: number) {
|
||||
const { user } = await getAuth();
|
||||
const supportedVersionNumber = await getSupportedVersionNumber();
|
||||
|
||||
if (!user || !user.accessCode) {
|
||||
throw new Error("User is not authenticated or accessCode is missing");
|
||||
|
@ -77,8 +77,8 @@ export const NameplateCustomization: FC<AvatarSelectionProps> = ({
|
||||
}, []);
|
||||
|
||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
||||
const unchangedNamePlateId = nameplateId;
|
||||
const newNamePlateId = data.nameplateId ?? unchangedNamePlateId;
|
||||
const defaultNamePlateId = nameplateId;
|
||||
const newNamePlateId = data.nameplateId ?? defaultNamePlateId;
|
||||
|
||||
updatePlayerNamePlate(newNamePlateId).then(() => {
|
||||
setNameplateId(newNamePlateId);
|
||||
@ -136,7 +136,7 @@ export const NameplateCustomization: FC<AvatarSelectionProps> = ({
|
||||
name="nameplateId"
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex flex-col">
|
||||
<FormLabel>Select Nameplate</FormLabel>
|
||||
<FormLabel className="pb-2">Select Nameplate</FormLabel>
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<FormControl>
|
||||
|
Reference in New Issue
Block a user