mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 03:31:23 +00:00
✨ feat: add product to cart
:%s
This commit is contained in:
@@ -48,7 +48,8 @@ export type Product = {
|
||||
options: ProductOption[]
|
||||
facetValueIds?: string[]
|
||||
collectionIds?: string[]
|
||||
collection?: string,
|
||||
collection?: string[],
|
||||
variants?: ProductVariant[]
|
||||
}
|
||||
|
||||
export type ProductCard = {
|
||||
|
@@ -54,7 +54,8 @@ export default function getProductOperation({
|
||||
values: og.options.map((o) => ({ label: o.name })),
|
||||
})),
|
||||
facetValueIds: product.facetValues.map(item=> item.id),
|
||||
collectionIds: product.collections.map(item => item.id)
|
||||
collectionIds: product.collections.map(item => item.id),
|
||||
collection:product.collections.map(item => item.name),
|
||||
} as Product
|
||||
}
|
||||
|
||||
|
2
framework/vendure/schema.d.ts
vendored
2
framework/vendure/schema.d.ts
vendored
@@ -3347,7 +3347,7 @@ export type GetProductQuery = { __typename?: 'Query' } & {
|
||||
collections: Array<
|
||||
{ __typename?: 'Collection' } & Pick<
|
||||
Collection,
|
||||
'id'
|
||||
'id'|"name"
|
||||
>
|
||||
>
|
||||
}
|
||||
|
@@ -41,6 +41,7 @@ export const getProductQuery = /* GraphQL */ `
|
||||
}
|
||||
collections {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user