Skip to content

Commit

Permalink
fix: code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton authored and kris-liu-smile committed Mar 10, 2023
1 parent c9f1681 commit 943d9bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,14 @@ export const ReAddToCart = (props: ShoppingProductsProps) => {
const quantityNumber = parseInt(`${quantity}`, 10) || 0
if (minQuantity !== 0 && quantityNumber < minQuantity) {
product.node.quantity = minQuantity
product.isValid = true
} else if (maxQuantity !== 0 && quantityNumber > maxQuantity) {
product.node.quantity = maxQuantity
product.isValid = true
}
if (isStock !== '0' && stock && quantity > stock) {
product.node.quantity = stock
product.isValid = true
}

product.isValid = true
})

setValidateFailureProducts(newProduct)
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/shared/service/request/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const originFetch = window.fetch

const responseResult = (path: string, res: any, resolve: any, init: any) => {
if (path.includes('current.jwt')) return res.text()
console.log(init)

if (init.method === 'DELETE') {
resolve()
}
Expand Down

0 comments on commit 943d9bf

Please sign in to comment.