File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
modules/collections/templates Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,17 @@ export async function GET(request: NextRequest) {
12
12
13
13
const { offset } = Object . fromEntries ( request . nextUrl . searchParams )
14
14
15
- const [ collections , count ] = await productService . listAndCountCollections (
16
- { } ,
17
- {
18
- skip : parseInt ( offset ) || 0 ,
19
- take : 100 ,
20
- }
21
- )
15
+ const [ collections , count ] = await productService
16
+ . listAndCountCollections (
17
+ { } ,
18
+ {
19
+ skip : parseInt ( offset ) || 0 ,
20
+ take : 100 ,
21
+ }
22
+ )
23
+ . catch ( ( e ) => {
24
+ return notFound ( )
25
+ } )
22
26
23
27
return NextResponse . json ( {
24
28
collections,
Original file line number Diff line number Diff line change 1
- import { Product , ProductCategory , ProductCollection } from "@medusajs/medusa"
2
1
import medusaRequest from "../medusa-fetch"
3
- import { StoreGetProductsParams } from "@medusajs/medusa"
2
+ import {
3
+ StoreGetProductsParams ,
4
+ Product ,
5
+ ProductCategory ,
6
+ ProductCollection ,
7
+ } from "@medusajs/medusa"
4
8
import { PricedProduct } from "@medusajs/medusa/dist/types/pricing"
5
9
6
10
export type ProductCategoryWithChildren = Omit <
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { useInfiniteQuery } from "@tanstack/react-query"
10
10
import { useCart } from "medusa-react"
11
11
import React , { useEffect } from "react"
12
12
import { useInView } from "react-intersection-observer"
13
- import { ProductCollection } from "@medusajs/product "
13
+ import { ProductCollection } from "@medusajs/medusa "
14
14
15
15
const CollectionTemplate : React . FC < { collection : ProductCollection } > = ( {
16
16
collection,
You can’t perform that action at this time.
0 commit comments