Closed BarryCarlyon closed 7 years ago
https://help.shopify.com/api/reference/asset
Getting a single asset works fine as asset.js line 20 sets the key to asset
asset
But the call to "Receive a list of all assets", uses the key assets, so the call fails/module returns no response.
Asset.prototype.get = function get(themeId, params) { const url = this.buildUrl(themeId, undefined, params); return this.shopify.request(url, 'GET', this.key); };
Something like, (before the return)
if (!params) { this.key = 'assets'; }
But not sure is this is the right fix
It should work as expected, see https://github.com/MONEI/Shopify-api-node/blob/d287b218734c2e68216581ef159013eb0133bbfd/mixins/base-child.js#L76-L79.
This is also tested: https://github.com/MONEI/Shopify-api-node/blob/d287b218734c2e68216581ef159013eb0133bbfd/test/asset.test.js#L15-L24.
Ah I need to call the list function instead of the get function
I didn't make a conncetion from Shopify docs to Module docs
https://help.shopify.com/api/reference/asset
Getting a single asset works fine as asset.js line 20 sets the key to
asset
But the call to "Receive a list of all assets", uses the key assets, so the call fails/module returns no response.
Something like, (before the return)
But not sure is this is the right fix