Skip to content

Commit

Permalink
Variant backorder validation (#1089)
Browse files Browse the repository at this point in the history
This pull request is similar to #997 

The variant backorder gives the same database error if there is no data
in the input.
  • Loading branch information
migsAV committed Jun 22, 2023
1 parent 76007ca commit 49bfb79
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/admin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- The iframe height on email previews has been increased to avoid cut off.
- Refactor row selection on tables to avoid extra roundtrips to Livewire.
- AttributeGroup saving will now pass the id if being edited to prevent false validation exception being thrown.
- Added a validation check for the product variant backorder.

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ protected function rules()
$this->hasPriceValidationRules(),
[
'variant.stock' => 'required|min:0|numeric|max:10000000',
'variant.backorder' => 'numeric|max:10000000',
'variant.backorder' => 'required|min:0|numeric|max:10000000',
'variant.purchasable' => 'string|required',
'variant.length_value' => 'numeric|nullable',
'variant.length_unit' => 'string|nullable',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected function rules()
'variant.volume_value' => 'numeric|nullable',
'variant.volume_unit' => 'string|nullable',
'variant.shippable' => 'boolean|nullable',
'variant.backorder' => 'numeric|max:10000000',
'variant.backorder' => 'required|min:0|numeric|max:10000000',
'variant.tax_ref' => 'nullable|string|max:255',
'variant.purchasable' => 'string|required',
'variant.unit_quantity' => 'required|numeric|min:1|max:10000000',
Expand Down

1 comment on commit 49bfb79

@vercel
Copy link

@vercel vercel bot commented on 49bfb79 Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.