Hi, I am relatively new to Gadget.dev. I have installed my app in my Shopify Test store and I am able to pull in order data based on the order/create webhook. When storing an order record in the shopifyOrder data the shopID is available in the field labelled as 'shop', based on the relation with shopifShop data record. I would like to add 'domain' and 'name' from the shopifyShop data as well to the order for downstream purpose. Does any body know how to do so via the create.js action? I have alreay created the fields 'shopDomain' and 'shopName' in the schema for shopifyOrder
Current create.js:
import { applyParams, save, ActionOptions } from "gadget-server";
import { preventCrossShopDataAccess } from "gadget-server/shopify";
/ @type { ActionRun } */
export const run = async ({ params, record, logger, api, connections }) => {
logger.info("Received webhook params:", params); // Log incoming params
applyParams(params, record);
logger.info("Record after applying params:", record.toJSON()); // Log the record
await preventCrossShopDataAccess(params, record);
await save(record);
logger.info("Record saved successfully.");
};
/ @type { ActionOnSuccess } */
export const onSuccess = async ({ params, record, logger, api, connections }) => {
logger.info("onSuccess triggered for record:", record.toJSON());
};
/** @type { ActionOptions } */
export const options = { actionType: "create" };
Thanks in advance