Skip to content

chore(templates): fix import path in ecommerce template#16364

Open
felipepalazzo wants to merge 1 commit into
payloadcms:mainfrom
felipepalazzo:fix/ecommerce-path-import
Open

chore(templates): fix import path in ecommerce template#16364
felipepalazzo wants to merge 1 commit into
payloadcms:mainfrom
felipepalazzo:fix/ecommerce-path-import

Conversation

@felipepalazzo
Copy link
Copy Markdown

Fixes #16361. Corrects stale route group reference introduced in #14947 and updates the preview prefix map to match the products collection (replacing the leftover posts entry that has no corresponding route).

What?

Fix two TypeScript errors in templates/ecommerce/src/utilities/generatePreviewPath.ts that break the ecommerce template build.

Why?

  • Import points to a route group that does not exist: @/app/(frontend)/next/preview/route
  • collectionPrefixMap references a posts collection that doesn't exist in this template, so callers passing collection: 'products' fail to type-check.

How?

  • Update import to @/app/(app)/next/preview/route.
  • Replace posts: '/posts' with products: '/products' in collectionPrefixMap.

Fixes payloadcms#16361. Corrects stale route group reference introduced in payloadcms#14947
and updates the preview prefix map to match the `products` collection
(replacing the leftover `posts` entry that has no corresponding route).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template: generatePreviewPath imports from wrong route group '(frontend)' instead of '(app)'

2 participants