prod-image.js
396 Bytes
function prodImage({ skn, sku, size }) {
const baseUrl = '/Api/platform/getRemoteImageUrlBySku';
const params = [];
if (skn) {
params.push(`skn_id=${skn}`);
}
if (sku) {
params.push(`sku_id=${sku}`);
}
params.push(size ? `size=${size}` : 'size=80x80');
params.push(`t=${new Date().getTime()}`);
return `${baseUrl}?${params.join('&')}`;
}
export default prodImage;