How to get the data list created and saved by Shopify app in cart transform extension
app/models/QRCode.server
-------------------------------------------------------------------------
import qrcode from "qrcode";
import invariant from "tiny-invariant";
import db from "../db.server";
export async function getQRCodes(shop, graphql) {
const qrCodes = await db.qRCode.findMany({
where: { shop },
orderBy: { id: "desc" },
});
if (qrCodes.length === 0) return [];
return Promise.all(
qrCodes.map((qrCode) => supplementQRCode(qrCode, graphql)),
);
}
getQRCodes function can get the db.qRCode list,but now,i want to get it’s in the cart transform extension.how can i do it?
extensions/cart-transform-demo/src/run.js
------------------------------------------------------------------------------
export async function run(input) {
// how to get db.qRCode in here function
const operations = input.cart.lines.reduce((acc, cartLine) => {
const expandOperation = optionallyBuildExpandOperation(cartLine, input);
if (expandOperation) {
return [...acc, { expand: expandOperation }];
}
return acc;
}, []);
return operations.length > 0 ? { operations } : NO_CHANGES;
}
I want to get the db.qRCode in run function,how to do it?