make image and file fields required
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
>
|
||||
</template>
|
||||
<FileDropzone
|
||||
:message="`Upload ${field.name || 'Attachments'}`"
|
||||
:message="`Upload ${field.name || 'Attachments'}${field.required ? '' : ' (optional)'}`"
|
||||
:submitter-slug="submitterSlug"
|
||||
@upload="onUpload"
|
||||
/>
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
<button
|
||||
type="submit"
|
||||
class="base-button w-full flex justify-center"
|
||||
:disabled="isSubmitting"
|
||||
:disabled="isSubmitting || (currentField.required && ['image', 'file'].includes(currentField.type) && !values[currentField.uuid]?.length)"
|
||||
>
|
||||
<span class="flex">
|
||||
<IconInnerShadowTop
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div>
|
||||
<FileDropzone
|
||||
v-if="!modelValue"
|
||||
:message="`Upload ${field.name || 'Image'}`"
|
||||
:message="`Upload ${field.name || 'Image'}${field.required ? '' : ' (optional)'}`"
|
||||
:submitter-slug="submitterSlug"
|
||||
:accept="'image/*'"
|
||||
@upload="onImageUpload"
|
||||
|
||||
Reference in New Issue
Block a user