Skip to content

Commit 7032cad

Browse files
committed
Fix bug of uploading images during product creation
1 parent 71b3e6a commit 7032cad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Http/Controllers/Api/ProductController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private function saveImages($images, $positions, Product $product)
156156
'url' => URL::to(Storage::url($relativePath)),
157157
'mime' => $image->getClientMimeType(),
158158
'size' => $image->getSize(),
159-
'position' => $positions[$id]
159+
'position' => $positions[$id] ?? $id + 1
160160
]);
161161
}
162162
}

0 commit comments

Comments
 (0)