mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
feat: add activate warranty to order details page
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import lineItemFragment from '../fragments/line-item';
|
||||
import { orderMetafields } from '../fragments/order';
|
||||
|
||||
// NOTE: https://shopify.dev/docs/api/customer/latest/queries/customer
|
||||
export const getCustomerOrderQuery = /* GraphQL */ `
|
||||
@@ -220,3 +221,12 @@ export const getCustomerOrderQuery = /* GraphQL */ `
|
||||
}
|
||||
${lineItemFragment}
|
||||
`;
|
||||
|
||||
export const getOrderMetafieldsQuery = /* GraphQL */ `
|
||||
query getOrderMetafields($id: ID!) {
|
||||
order(id: $id) {
|
||||
...OrderMetafield
|
||||
}
|
||||
}
|
||||
${orderMetafields}
|
||||
`;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import customerDetailsFragment from '../fragments/customer-details';
|
||||
import { orderMetafields } from '../fragments/order';
|
||||
|
||||
const customerFragment = `#graphql
|
||||
`;
|
||||
@@ -19,18 +20,10 @@ export const getCustomerOrderMetafieldsQuery = /* GraphQL */ `
|
||||
customer(id: $id) {
|
||||
orders(first: 20, sortKey: PROCESSED_AT, reverse: true) {
|
||||
nodes {
|
||||
id
|
||||
warrantyStatus: metafield(namespace: "custom", key: "warranty_status") {
|
||||
value
|
||||
}
|
||||
warrantyActivationDeadline: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_deadline"
|
||||
) {
|
||||
value
|
||||
}
|
||||
...OrderMetafield
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
${orderMetafields}
|
||||
`;
|
||||
|
Reference in New Issue
Block a user