Skip to content

Commit

Permalink
working sample
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprudhomme committed Nov 11, 2024
1 parent aa14374 commit efd3d71
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion packages/samples/headless-ssr-commerce/app/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default async function Search() {
const navigatorContext = new NextJsNavigatorContext(headers());
searchEngineDefinition.setNavigatorContextProvider(() => navigatorContext);

const context = await getContext();
// Fetches the cart items from an external service
const items = await externalCartAPI.getCart();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import {
ListingHydratedState,
ListingStaticState,
} from '@/lib/commerce-engine';
import {
loadSearchActions,
NavigatorContext,
} from '@coveo/headless-react/ssr-commerce';
import {NavigatorContext} from '@coveo/headless-react/ssr-commerce';
import {PropsWithChildren, useEffect, useState} from 'react';

interface ListingPageProps {
Expand Down Expand Up @@ -41,9 +38,6 @@ export default function ListingProvider({
})
.then(({engine, controllers}) => {
setHydratedState({engine, controllers});
engine.addReducers({});
const {executeSearch} = loadSearchActions(engine);
engine.dispatch(executeSearch());
// Refreshing recommendations in the browser after hydrating the state in the client-side
// Recommendation refresh in the server is not supported yet.
// controllers.popularBoughtRecs.refresh(); // FIXME: does not work
Expand Down

0 comments on commit efd3d71

Please sign in to comment.