Skip to content

Commit

Permalink
🚸 Disable delivery mode editing for physical only edition
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Aug 5, 2024
1 parent 933df40 commit fbbb1ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pages/nft-book-store/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
</UFormGroup>
<URadioGroup
v-model="p.deliveryMethod"
:disabled="p.isPhysicalOnly"
:legend="`Delivery method of this ${priceItemLabel}`"
:options="deliverMethodOptions"
/>
Expand Down Expand Up @@ -753,7 +754,7 @@ function mapPrices (prices: any) {
priceInDecimal: Math.round(Number(p.price) * 100),
price: Number(p.price),
stock: Number(p.stock),
isAutoDeliver: p.deliveryMethod === 'auto',
isAutoDeliver: !p.isPhysicalOnly && p.deliveryMethod === 'auto',
isAllowCustomPrice: p.isAllowCustomPrice || false,
autoMemo: p.deliveryMethod === 'auto' ? p.autoMemo || '' : '',
hasShipping: p.hasShipping || false,
Expand Down
4 changes: 2 additions & 2 deletions pages/nft-book-store/status/[classId]/edit/[editionIndex].vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<URadioGroup
v-model="deliveryMethod"
:disabled="oldIsAutoDeliver"
:disabled="oldIsAutoDeliver || isPhysicalOnly"
:legend="`Delivery method of this ${priceItemLabel}`"
:options="deliverMethodOptions"
/>
Expand Down Expand Up @@ -439,7 +439,7 @@ async function handleSubmit () {
priceInDecimal: Math.round(Number(price.value) * 100),
price: Number(price.value),
stock: Number(stock.value),
isAutoDeliver: isAutoDeliver.value,
isAutoDeliver: !isPhysicalOnly.value && isAutoDeliver.value,
autoMemo: autoMemo.value || '',
hasShipping: hasShipping.value || false,
isPhysicalOnly: isPhysicalOnly.value || false,
Expand Down
3 changes: 2 additions & 1 deletion pages/nft-book-store/status/[classId]/edit/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

<URadioGroup
v-model="deliveryMethod"
:disabled="isPhysicalOnly"
:legend="`Delivery method of this ${priceItemLabel}`"
:options="deliverMethodOptions"
/>
Expand Down Expand Up @@ -405,7 +406,7 @@ async function handleSubmit () {
priceInDecimal: Math.round(Number(price.value) * 100),
price: Number(price.value),
stock: Number(stock.value),
isAutoDeliver: deliveryMethod.value === 'auto',
isAutoDeliver: !isPhysicalOnly.value && deliveryMethod.value === 'auto',
autoMemo: deliveryMethod.value === 'auto' ? (autoMemo.value || '') : '',
hasShipping: hasShipping.value || false,
isPhysicalOnly: isPhysicalOnly.value || false,
Expand Down

0 comments on commit fbbb1ee

Please sign in to comment.