Skip to content

Commit

Permalink
👔 Default enable allow custom price
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Aug 5, 2024
1 parent fbbb1ee commit f5d9cb6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pages/nft-book-store/collection/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ const price = ref({
stock: Number(route.query.count as string || 1),
hasShipping: false,
isPhysicalOnly: false,
isAllowCustomPrice: false
isAllowCustomPrice: true
})
const shippingRates = ref<any[]>([])
const moderatorWallets = ref<string[]>([])
Expand Down Expand Up @@ -611,7 +611,7 @@ function formatPrice (price: any) {
stock: Number(price.stock),
hasShipping: Boolean(price.hasShipping || shippingRates.value.length || false),
isPhysicalOnly: Boolean(price.isPhysicalOnly || false),
isAllowCustomPrice: Boolean(price.isAllowCustomPrice || false)
isAllowCustomPrice: Boolean(price.isAllowCustomPrice ?? true)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const descriptionEn = ref('')
const descriptionZh = ref('')
const image = ref('')
const hasShipping = ref(false)
const isAllowCustomPrice = ref(false)
const isAllowCustomPrice = ref(true)
const isPhysicalOnly = ref(false)
const shippingRates = ref<any[]>([])
const isUpdatingShippingRates = ref(false)
Expand Down Expand Up @@ -372,7 +372,7 @@ async function handleSubmit () {
stock: Number(stock.value),
hasShipping: hasShipping.value || false,
isPhysicalOnly: isPhysicalOnly.value || false,
isAllowCustomPrice: isAllowCustomPrice.value || false
isAllowCustomPrice: isAllowCustomPrice.value ?? true
}
if (!editedPrice || editedPrice.price === undefined) {
Expand Down
4 changes: 2 additions & 2 deletions pages/nft-book-store/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ function addMorePrice () {
descriptionZh: '',
hasShipping: false,
isPhysicalOnly: false,
isAllowCustomPrice: false
isAllowCustomPrice: true
})
}
Expand Down Expand Up @@ -755,7 +755,7 @@ function mapPrices (prices: any) {
price: Number(p.price),
stock: Number(p.stock),
isAutoDeliver: !p.isPhysicalOnly && p.deliveryMethod === 'auto',
isAllowCustomPrice: p.isAllowCustomPrice || false,
isAllowCustomPrice: p.isAllowCustomPrice ?? true,
autoMemo: p.deliveryMethod === 'auto' ? p.autoMemo || '' : '',
hasShipping: p.hasShipping || false,
isPhysicalOnly: p.isPhysicalOnly || false
Expand Down
6 changes: 3 additions & 3 deletions pages/nft-book-store/status/[classId]/edit/[editionIndex].vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const descriptionEn = ref('')
const descriptionZh = ref('')
const hasShipping = ref(false)
const isPhysicalOnly = ref(false)
const isAllowCustomPrice = ref(false)
const isAllowCustomPrice = ref(true)
const shippingRates = ref<any[]>([])
const isUpdatingShippingRates = ref(false)
const oldStock = ref(0)
Expand Down Expand Up @@ -350,7 +350,7 @@ onMounted(async () => {
descriptionZh.value = currentEdition.description?.zh || legacyDescription || ' '
hasShipping.value = !!(currentEdition.hasShipping) || false
isPhysicalOnly.value = currentEdition.isPhysicalOnly || false
isAllowCustomPrice.value = currentEdition.isAllowCustomPrice || false
isAllowCustomPrice.value = currentEdition.isAllowCustomPrice ?? true
oldStock.value = currentEdition.stock
oldIsAutoDeliver.value = currentEdition.isAutoDeliver
Expand Down Expand Up @@ -443,7 +443,7 @@ async function handleSubmit () {
autoMemo: autoMemo.value || '',
hasShipping: hasShipping.value || false,
isPhysicalOnly: isPhysicalOnly.value || false,
isAllowCustomPrice: isAllowCustomPrice.value || false
isAllowCustomPrice: isAllowCustomPrice.value ?? true
}
if (!editedPrice || editedPrice.price === undefined) {
Expand Down
4 changes: 2 additions & 2 deletions pages/nft-book-store/status/[classId]/edit/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const descriptionZh = ref('')
const hasShipping = ref(false)
const shippingRates = ref<any[]>([])
const isPhysicalOnly = ref(false)
const isAllowCustomPrice = ref(false)
const isAllowCustomPrice = ref(true)
const isUpdatingShippingRates = ref(false)
const priceItemLabel = computed(() => hasMultiplePrices.value ? 'edition' : 'book')
Expand Down Expand Up @@ -410,7 +410,7 @@ async function handleSubmit () {
autoMemo: deliveryMethod.value === 'auto' ? (autoMemo.value || '') : '',
hasShipping: hasShipping.value || false,
isPhysicalOnly: isPhysicalOnly.value || false,
isAllowCustomPrice: isAllowCustomPrice.value || false
isAllowCustomPrice: isAllowCustomPrice.value ?? true
}
if (!editedPrice || editedPrice.price === undefined) {
Expand Down

0 comments on commit f5d9cb6

Please sign in to comment.