make image and file fields required

pull/105/head
Alex Turchyn 2 years ago
parent 0b4a2819dd
commit b7eb6cacc2

@ -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"

Loading…
Cancel
Save