mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 12:11:22 +00:00
Resolve isColorProductOption duplication
This commit is contained in:
parent
01c702a87e
commit
bf4adbdd2c
@ -33,3 +33,14 @@ export interface SpreeProductImage extends JsonApiDocument {
|
|||||||
styles: ImageStyle[]
|
styles: ImageStyle[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface OptionTypeAttr extends JsonApiDocument {
|
||||||
|
attributes: {
|
||||||
|
name: string
|
||||||
|
presentation: string
|
||||||
|
position: number
|
||||||
|
created_at: string
|
||||||
|
updated_at: string
|
||||||
|
filterable: boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -12,14 +12,14 @@ import type {
|
|||||||
JsonApiSingleResponse,
|
JsonApiSingleResponse,
|
||||||
} from '@spree/storefront-api-v2-sdk/types/interfaces/JsonApi'
|
} from '@spree/storefront-api-v2-sdk/types/interfaces/JsonApi'
|
||||||
import type { OrderAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Order'
|
import type { OrderAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Order'
|
||||||
import { ProductAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Product'
|
import type { ProductAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Product'
|
||||||
import type { RelationType } from '@spree/storefront-api-v2-sdk/types/interfaces/Relationships'
|
import type { RelationType } from '@spree/storefront-api-v2-sdk/types/interfaces/Relationships'
|
||||||
import createGetAbsoluteImageUrl from './create-get-absolute-image-url'
|
import createGetAbsoluteImageUrl from './create-get-absolute-image-url'
|
||||||
import getMediaGallery from './get-media-gallery'
|
import getMediaGallery from './get-media-gallery'
|
||||||
import { findIncluded, findIncludedOfType } from './find-json-api-documents'
|
import { findIncluded, findIncludedOfType } from './find-json-api-documents'
|
||||||
|
import type { OptionTypeAttr } from '@framework/types'
|
||||||
|
|
||||||
const isColorProductOption = (productOptionType: any) => {
|
const isColorProductOption = (productOptionType: OptionTypeAttr) => {
|
||||||
// TODO: Fix type and merge with isColorProductOption in framework/spree/utils/expandOptions.ts
|
|
||||||
return productOptionType.attributes.presentation === 'Color'
|
return productOptionType.attributes.presentation === 'Color'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user