diff --git a/app/Services/Master/ProductService.php b/app/Services/Master/ProductService.php index 0a49bb0..14aa1d9 100644 --- a/app/Services/Master/ProductService.php +++ b/app/Services/Master/ProductService.php @@ -681,12 +681,6 @@ private function applyVariantImageChanges( } $this->copyRequestVariantImages($verificationRequest, $index, $variant); - - if ($variant->getMedia('images')->isEmpty()) { - throw ValidationException::withMessages([ - "variants.{$index}.images" => 'Foto varian wajib diisi.', - ]); - } } private function copyRequestVariantImages(OwnerVerificationRequest $verificationRequest, int $index, ProductVariant $variant): void diff --git a/resources/js/components/owner-verification/OwnerVerificationRowActions.vue b/resources/js/components/owner-verification/OwnerVerificationRowActions.vue index fd5d98b..5ab78cd 100644 --- a/resources/js/components/owner-verification/OwnerVerificationRowActions.vue +++ b/resources/js/components/owner-verification/OwnerVerificationRowActions.vue @@ -55,8 +55,10 @@ function submitApprove() { .post(approveUrl.value, { preserveScroll: true, onError: (errors: Record) => { - if (errors.system) { - toast.error(errors.system); + const firstError = Object.values(errors)[0]; + + if (firstError) { + toast.error(firstError); } }, }); @@ -71,8 +73,10 @@ function submitReject() { rejectForm.reset(); }, onError: (errors: Record) => { - if (errors.system) { - toast.error(errors.system); + const firstError = Object.values(errors)[0]; + + if (firstError) { + toast.error(firstError); } }, });