Closed dalssoft closed 2 years ago
With the upcoming release of the "ID field" feature (https://github.com/herbsjs/gotu/issues/46), it would be possible to read the entity's metadata and, as a convention, use those IDs that today need to be explicitly defined.
const controllerList = [ { name: 'lists', getAll: { usecase: require('../usecases/getLists'), controller: require('../controller') }, getById: { usecase: require('../usecases/getLists'), id: 'listId' }, // <---- `id` would not be necessary post: { usecase: require('../usecases/createList') }, put: { usecase: require('../usecases/updateList') }, delete: { usecase: require('../usecases/deleteList') } } ]
Explicitly defining IDs would still be possible, but not mandatory for entities with IDs.
I can work on this issue.
@mtperesvx did you send a PR?
@dalssoft hi. https://github.com/herbsjs/herbs2rest/pull/33#event-6888720180
With the upcoming release of the "ID field" feature (https://github.com/herbsjs/gotu/issues/46), it would be possible to read the entity's metadata and, as a convention, use those IDs that today need to be explicitly defined.
Explicitly defining IDs would still be possible, but not mandatory for entities with IDs.