api-platform / admin

A beautiful and fully-featured administration interface builder for hypermedia APIs
https://api-platform.com/docs/admin/
MIT License
477 stars 131 forks source link

useOnSubmit hook for Create/ EditGuessers #542

Closed PawelSuwinski closed 3 months ago

PawelSuwinski commented 3 months ago

Refactored form submit handler and moved to stand alone hook. It makes easier to write custom form components with introspection without copy/ paste of save callback code from Guessers components.

See #540.

fzaninotto commented 3 months ago

This does indeed look like a progress in comparison with the previous version.

However, I still think that you should package the logic into a component that developers can paste and then modify. If you follow the react-admin conventions, the Guesser should just just render a series of components and paste them to the console so that the developer can customize them. It seems that part of the logic you've put in the guessers should be in some specific HydraEdit, HydraCreate and HydraList components.

But I understand it's not the purpose of this PR, so LGTM.