@@ -337,7 +337,14 @@ export async function getCategoryByHandle(categoryHandle: string[]): Promise<{
337
337
} > {
338
338
if ( PRODUCT_MODULE_ENABLED ) {
339
339
DEBUG && console . log ( "PRODUCT_MODULE_ENABLED" )
340
- const data = await fetch ( `${ API_BASE_URL } /api/categories/${ categoryHandle } ` )
340
+ const data = await fetch (
341
+ `${ API_BASE_URL } /api/categories/${ categoryHandle } ` ,
342
+ {
343
+ next : {
344
+ tags : [ "categories" ] ,
345
+ } ,
346
+ }
347
+ )
341
348
. then ( ( res ) => res . json ( ) )
342
349
. catch ( ( err ) => {
343
350
throw err
@@ -348,9 +355,9 @@ export async function getCategoryByHandle(categoryHandle: string[]): Promise<{
348
355
349
356
DEBUG && console . log ( "PRODUCT_MODULE_DISABLED" )
350
357
351
- const handles = categoryHandle . map ( ( handle : string , index : number ) => {
352
- return categoryHandle . slice ( 0 , index + 1 ) . join ( "/" )
353
- } )
358
+ const handles = categoryHandle . map ( ( handle : string , index : number ) =>
359
+ categoryHandle . slice ( 0 , index + 1 ) . join ( "/" )
360
+ )
354
361
355
362
const product_categories = [ ] as ProductCategoryWithChildren [ ]
356
363
@@ -398,7 +405,12 @@ export async function getProductsByCategoryHandle({
398
405
if ( PRODUCT_MODULE_ENABLED ) {
399
406
DEBUG && console . log ( "PRODUCT_MODULE_ENABLED" )
400
407
const { response, nextPage } = await fetch (
401
- `${ API_BASE_URL } /api/categories/${ handle } ?currency_code=${ currencyCode } &page=${ pageParam . toString ( ) } `
408
+ `${ API_BASE_URL } /api/categories/${ handle } ?currency_code=${ currencyCode } &page=${ pageParam . toString ( ) } ` ,
409
+ {
410
+ next : {
411
+ tags : [ "categories" ] ,
412
+ } ,
413
+ }
402
414
)
403
415
. then ( ( res ) => res . json ( ) )
404
416
. catch ( ( err ) => {
0 commit comments