fix some things
This commit is contained in:
@@ -10,6 +10,7 @@ export type ProductImageSource = {
|
||||
file?: { id?: number | null; src?: string | null; full_src?: string | null; url?: string | null } | null
|
||||
file_id?: number | string | null
|
||||
img?: string | null
|
||||
image?: string | null
|
||||
group_type?: string | null
|
||||
} | null | undefined
|
||||
|
||||
@@ -103,7 +104,7 @@ export function getProductFallbackImage(product?: ProductImageSource): string {
|
||||
}
|
||||
|
||||
export function resolveProductImageSrc(product?: ProductImageSource): string {
|
||||
const remoteSrc = product?.file?.full_src || product?.file?.url || product?.file?.src
|
||||
const remoteSrc = product?.file?.full_src || product?.file?.url || product?.file?.src || product?.image || product?.img
|
||||
if (isUsableImageSrc(remoteSrc)) {
|
||||
const url = absolutizeImageUrl(remoteSrc!.trim())
|
||||
const version = product?.file_id ?? product?.file?.id
|
||||
|
||||
@@ -277,7 +277,7 @@ export function getTvProductBuyPrice(product?: Product | null): number {
|
||||
}
|
||||
const unit = tvBuyUnitPrice(product)
|
||||
if (unit > 0) {
|
||||
return unit + resolveProductCashFeeBuyRial(product, unit)
|
||||
return unit
|
||||
}
|
||||
return getProductBuyPrice(product)
|
||||
}
|
||||
@@ -288,7 +288,7 @@ export function getTvProductSellPrice(product?: Product | null): number {
|
||||
}
|
||||
const unit = tvSellUnitPrice(product)
|
||||
if (unit > 0) {
|
||||
return unit - resolveProductCashFeeSellRial(product, unit)
|
||||
return unit
|
||||
}
|
||||
return getProductSellPrice(product)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user