refactor: remove mandatory image validation for product variants and improve error handling in owner verification actions

This commit is contained in:
Yoga Pangestu 2026-07-01 11:50:39 +07:00
parent ad73da5885
commit 8eee3b04ce
2 changed files with 8 additions and 10 deletions

View File

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

View File

@ -55,8 +55,10 @@ function submitApprove() {
.post(approveUrl.value, {
preserveScroll: true,
onError: (errors: Record<string, string>) => {
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<string, string>) => {
if (errors.system) {
toast.error(errors.system);
const firstError = Object.values(errors)[0];
if (firstError) {
toast.error(firstError);
}
},
});