feat: add supplier return to productVariant

Signed-off-by: jrphilo <james.philo@me.com>
This commit is contained in:
jrphilo 2024-07-12 09:14:15 +02:00
parent d2dda09a13
commit 20b79bd751
No known key found for this signature in database
GPG Key ID: A8BAD7933F97046F
3 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,9 @@ const productFragment = /* GraphQL */ `
mileage: metafield(namespace: "custom", key: "mileage") {
value
}
supplier: metafield(namespace: "custom", key: "supplier") {
value
}
condition: metafield(namespace: "custom", key: "condition") {
value
}

View File

@ -477,6 +477,7 @@ const reshapeVariants = (variants: ShopifyProductVariant[]): ProductVariant[] =>
coreVariantId: variant.coreVariantId?.value || null,
coreCharge: parseMetaFieldValue<Money>(variant.coreCharge),
mileage: variant.mileage?.value ?? null,
supplier: variant.supplier?.value || null,
estimatedDelivery: variant.estimatedDelivery?.value || null,
condition: variant.condition?.value || null,
...(addOnProductId

View File

@ -459,6 +459,7 @@ export type ProductVariant = {
coreVariantId: string | null;
mileage: number | null;
estimatedDelivery: string | null;
supplier: string | null;
condition: string | null;
engineCylinders: string | null;
fuelType: string | null;
@ -489,6 +490,7 @@ export type ShopifyProductVariant = Omit<
| 'coreVariantId'
| 'mileage'
| 'estimatedDelivery'
| 'supplier'
| 'condition'
| 'addOnProduct'
> & {
@ -497,6 +499,7 @@ export type ShopifyProductVariant = Omit<
coreCharge: { value: string } | null;
mileage: { value: number } | null;
estimatedDelivery: { value: string } | null;
supplier: { value: string } | null;
condition: { value: string } | null;
addOnProductId: { value: string } | null;
addOnQuantity: { value: string } | null;