i wanna integrate shopify api in my strapi app , kind of i wanna manage the store using strapi ! i followed a tutorial but it didn’t work for me i get this error :
{"statusCode":401,"error":"Unauthorized","message":"Unauthorized"}
! this is my code in api/product/controllers/product.js:
const { sanitizeEntity } = require('strapi-utils');
const Shopify = require('shopify-api-node');
const shopify = new Shopify({
shopName: 'bla-bla',
apiKey: 'shopify_api_key_here',
password: 'shopify_app_password_here'
});
module.exports = {
async findOne(ctx) {
const { id } = ctx.params;
const entity = await strapi.services.product.findOne({ id });
entity.shopify = await shopify.product.get(entity.shopifyID);
return sanitizeEntity(entity, { model: strapi.models.product });
},
};