Skip to content

Commit

Permalink
Add empty image file validation
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMejia77 committed Aug 26, 2024
1 parent 618d48b commit 180c532
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/(admin)/atc24$rw/admin/components/ReviewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export const ReviewForm = ({ review }: ReviewFormProps) => {
values: z.infer<typeof reviewSchema>,
token: string
) => {
if(!acceptedFiles[0]){
return toast.error("Debes seleccionar una imagen");
};

const formData: FormData = createFormData({
...values,
file: acceptedFiles[0],
Expand Down

0 comments on commit 180c532

Please sign in to comment.