fix(admin-ui): Fix variant creation when no stock locations provided (#4843)
* Update check on variant creation, whether to create stock locations * Create spicy-shoes-type.md
This commit is contained in:
6
.changeset/spicy-shoes-type.md
Normal file
6
.changeset/spicy-shoes-type.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/admin-ui": patch
|
||||
"@medusajs/admin": patch
|
||||
---
|
||||
|
||||
fix(admin-ui): Fix variant creation when no stock locations provided
|
||||
@@ -79,7 +79,7 @@ const AddVariantModal = ({ open, onClose, product }: Props) => {
|
||||
delete data.stock.stock_location
|
||||
|
||||
onAddVariant(createAddPayload(data), (productRes) => {
|
||||
if (typeof stock_location !== "undefined") {
|
||||
if (stock_location?.length) {
|
||||
createStockLocationsForVariant(productRes, stock_location).then(() => {
|
||||
resetAndClose()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user