This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = async ({ api, record, params, logger, connections }) => { | |
const metafieldNamespace = "<Your metafield namespace>"; | |
const metafieldKey = "<Your metafield key>"; | |
const metafieldType = "json" | |
const metafieldOwnerId = `gid://shopify/Shop/${record.id}`; // `record.id` here is the ID of our `shop` record | |
const gadgetFieldName = "<The matching field name in your gadget record, e.g. myMetafield>"; | |
// Check if record change includes our metafield data | |
if (record.changed(gadgetFieldName)) { | |
logger.info( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import axios, { post } from 'axios'; | |
class SimpleReactFileUpload extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state ={ | |
file:null | |
} |