@@ -8,6 +8,7 @@ import shopify from "./shopify.js";
8
8
import productCreator from "./product-creator.js" ;
9
9
import GDPRWebhookHandlers from "./gdpr.js" ;
10
10
import { GraphqlQueryError } from "@shopify/shopify-api" ;
11
+ import metafields from "./metafields.js" ;
11
12
12
13
const PORT = parseInt ( process . env . BACKEND_PORT || process . env . PORT , 10 ) ;
13
14
@@ -58,7 +59,7 @@ app.get("/api/deliveryCustomization/:id", async (req, res) => {
58
59
query : `query DeliveryCustomization($id: ID!) {
59
60
deliveryCustomization(id: $id) {
60
61
id
61
- metafield(namespace: "delivery-customization ", key: "function-configuration ") {
62
+ metafield(namespace: "${ metafields . namespace } ", key: "${ metafields . key } ") {
62
63
value
63
64
}
64
65
}
@@ -134,8 +135,8 @@ app.put("/api/deliveryCustomization/update", async (req, res) => {
134
135
metafieldsSet(metafields: [
135
136
{
136
137
ownerId: $customizationId
137
- namespace: "delivery-customization "
138
- key: "function-configuration "
138
+ namespace: "${ metafields . namespace } "
139
+ key: "${ metafields . key } "
139
140
value: $configurationValue
140
141
type: "json"
141
142
}
@@ -215,8 +216,8 @@ app.post("/api/deliveryCustomization/create", async (req, res) => {
215
216
metafieldsSet(metafields: [
216
217
{
217
218
ownerId: $customizationId
218
- namespace: "delivery-customization "
219
- key: "function-configuration "
219
+ namespace: "${ metafields . namespace } "
220
+ key: "${ metafields . key } "
220
221
value: $configurationValue
221
222
type: "json"
222
223
}
0 commit comments