Skip to content

Commit c90abd4

Browse files
committed
fix: tweak r2 paths
1 parent 0959827 commit c90abd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/r2.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { errorWithResponse } from './http.js';
2222
* @returns {Promise<Product>} - A promise that resolves to the product.
2323
*/
2424
export async function fetchProduct(ctx, config, sku) {
25-
const key = `${config.org}/${config.site}/${config.env}/${config.storeCode}/${config.storeViewCode}/${sku}.json`;
25+
const key = `${config.org}/${config.site}/${config.env}/${config.storeCode}/${config.storeViewCode}/products/${sku}.json`;
2626
const object = await ctx.env.CATALOG_BUCKET.get(key);
2727

2828
if (!object) {
@@ -52,7 +52,7 @@ export async function saveProducts(ctx, config, products) {
5252
const storePromises = batch.map(async (product) => {
5353
try {
5454
const { sku, name, urlKey } = product;
55-
const key = `${config.org}/${config.site}/${config.env}/${config.storeCode}/${config.storeViewCode}/${sku}.json`;
55+
const key = `${config.org}/${config.site}/${config.env}/${config.storeCode}/${config.storeViewCode}/products/${sku}.json`;
5656
const body = JSON.stringify(product);
5757
const customMetadata = { sku, name, urlKey };
5858

0 commit comments

Comments
 (0)