cancel
Showing results for 
Search instead for 
Did you mean: 

[FE Mockserver] Create for OData V2

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

I would like to know how to manage the creation in the mock context when I code submitChanges() ?

I tried all the handlers I found into the Git repository documentation but no one seams to react when I do the submitChange.

To be more specific, two methods are called :

  • getInitialDataset
  • addEntry

Maybe the addEntry is my solution, but how does it works ?

By the way, gregorw is it possible to provide CRUD sample in Fiori Tools Sample ?

Regards,

Joseph

Accepted Solutions (0)

Answers (1)

Answers (1)

nicolas_lunet
Employee
Employee
0 Kudos

If you plan on intercepting and modifying what has been sent for a create then addEntry is what you are looking for indeed.

You can see how it works similarly with the updateEntry here https://github.com/SAP/open-ux-odata/blob/172238c9191de9fd2484ad643cb3cf72f67450fd/packages/fe-mocks... but the addEntry would behave the same, you would have to call this.base.addEntry with the updated payload for it to be saved.

Hope this helps !