1

I created a new page in Spartacus. On this page, I also wrote the necessary services to receive the data from the backend. I created a WSDTO class for my new page. As with PDP - PLP pages when the page is opened, Google vs. I also made the fieldSetLevelMapping settings in the Network field in browsers.

But I am getting an error in spartacus because my new page in spartacus is not defined in OccEndpoint. How can I define a new page in Spartacus like default pages in OccEndpoint.

This is how data comes in under Network in PLP. This way I want the data inside my new sheet. How can I do this?

enter image description here

What I did in the backend: Populator class and Controller class are also available.

enter image description here

enter image description here

enter image description here

What I did in Spartacus:

enter image description here

ERROR : enter image description here

Rabia
  • 91
  • 6

1 Answers1

2

Could you check this way?

import { OccConfig, OccEndpoint } from '@spartacus/core';

export interface YourOccEndpoints {
  wishListDcatalog?: string | OccEndpoint;
}

declare module '@spartacus/core' {
  interface OccEndpoints extends YourOccEndpoints {}
}

and

const yourOccEndpoints: YourOccEndpoints = {
  wishListDcatalog: '...',
};

export const yourOccConfig: OccConfig = {
  backend: {
    occ: {
      //...
      endpoints: {
        ...yourOccEndpoints,      
      },
    },
  },
};       

then provide it in your app module provideConfig(yourOccConfig),

Michał Gruca
  • 393
  • 1
  • 7
  • Good answer, followed this and the Out of the Box code as well which is doing the same to add new constants with endpoints into existing collection. Although, I fail to understand this code in its entirety due to my illiteracy! – Raj Pawan Gumdal Jul 06 '23 at 04:09