diff --git a/api/src/db/data.db b/api/src/db/data.db index 5b419ab..424b416 100644 Binary files a/api/src/db/data.db and b/api/src/db/data.db differ diff --git a/ecommerce/src/main.tsx b/ecommerce/src/main.tsx index 4722776..f6c2f17 100644 --- a/ecommerce/src/main.tsx +++ b/ecommerce/src/main.tsx @@ -15,6 +15,14 @@ declare module "@tanstack/react-router" { const router = createRouter({ routeTree, + /** + * We want this because we want to be able to reuse our route string constants in routes.ts... if we didn't do this, + * then the route generation has a mix of keys with trailing slash, but the path of the route wouldn't have the slash. + * When we specify always, it will always require a trailing slash in our URLS. The default is never, which would + * strip out the trailing slash, if we provided it, which would cause issues for routes that have it. When it gets + * stripped out, and we're dealing with an index file, then it assumes params are required + */ + trailingSlash: "always", history: createHashHistory(), }); diff --git a/ecommerce/src/routes.ts b/ecommerce/src/routes.ts index 02017a1..0ebe0d2 100644 --- a/ecommerce/src/routes.ts +++ b/ecommerce/src/routes.ts @@ -4,4 +4,4 @@ export const RouteViewProducts = "/products/"; export const RouteViewProduct = `${RouteViewProducts}$productId`; -export const RouteViewCart = "/cart"; +export const RouteViewCart = "/cart/"; diff --git a/ecommerce/src/routes/cart/route.tsx b/ecommerce/src/routes/cart/index.tsx similarity index 100% rename from ecommerce/src/routes/cart/route.tsx rename to ecommerce/src/routes/cart/index.tsx