fix[UI]: General setting form tag input not propogating updates to form.

- chore: set allowed file upload size to 500 mb in zod schema.
This commit is contained in:
Abhinav Raut
2025-02-21 22:16:20 +05:30
parent 0649633878
commit 1a7f53628b
2 changed files with 25 additions and 22 deletions

View File

@@ -1,8 +1,5 @@
<template> <template>
<form <form @submit="onSubmit" class="space-y-6 w-full">
@submit="onSubmit"
class="space-y-6 w-full"
>
<FormField v-slot="{ field }" name="site_name"> <FormField v-slot="{ field }" name="site_name">
<FormItem> <FormItem>
<FormLabel>Site Name</FormLabel> <FormLabel>Site Name</FormLabel>
@@ -126,22 +123,28 @@
</FormItem> </FormItem>
</FormField> </FormField>
<FormField name="allowed_file_upload_extensions" v-slot="{ componentField }">
<FormItem> <FormField name="allowed_file_upload_extensions" v-slot="{ componentField, handleChange }">
<FormLabel>Allowed file upload extensions</FormLabel> <FormItem>
<FormControl> <FormLabel>Allowed file upload extensions</FormLabel>
<TagsInput v-model="componentField.modelValue"> <FormControl>
<TagsInputItem v-for="item in componentField.modelValue" :key="item" :value="item"> <TagsInput
<TagsInputItemText /> :modelValue="componentField.modelValue"
<TagsInputItemDelete /> @update:modelValue="handleChange"
</TagsInputItem> >
<TagsInputInput placeholder="jpg" /> <TagsInputItem v-for="item in componentField.modelValue" :key="item" :value="item">
</TagsInput> <TagsInputItemText />
</FormControl> <TagsInputItemDelete />
<FormDescription>Use `*` to allow any file.</FormDescription> </TagsInputItem>
<FormMessage /> <TagsInputInput placeholder="jpg" />
</FormItem> </TagsInput>
</FormField> </FormControl>
<FormDescription>Use `*` to allow any file.</FormDescription>
<FormMessage />
</FormItem>
</FormField>
<Button type="submit" :isLoading="formLoading"> {{ submitLabel }} </Button> <Button type="submit" :isLoading="formLoading"> {{ submitLabel }} </Button>
</form> </form>
</template> </template>

View File

@@ -35,8 +35,8 @@ export const formSchema = z.object({
.min(1, { .min(1, {
message: 'Max upload file size must be at least 1 MB.' message: 'Max upload file size must be at least 1 MB.'
}) })
.max(30, { .max(500, {
message: 'Max upload file size cannot exceed 30 MB.' message: 'Max upload file size cannot exceed 500 MB.'
}), }),
allowed_file_upload_extensions: z.array(z.string()).nullable().default([]).optional() allowed_file_upload_extensions: z.array(z.string()).nullable().default([]).optional()
}) })