herbsjs / herbs2rest

Create a REST API based on HerbsJS
MIT License
2 stars 13 forks source link

App break if not all routes is specified #45

Closed jhomarolo closed 2 years ago

jhomarolo commented 2 years ago

Describe the bug My app doesn't do all CRUD operations, including a getAll route. This causes the latest version of herbs2rest to break, as it doesn't find a usecase of type readAll.

https://github.com/herbsjs/herbs2rest/blob/27f2dff4a5dd35af91f72699f2f58c8985a89828/src/generateControllers.js#L36

This line always expects a usecase will be found, and in my case wont happen because I don't have a readAll usecase in my app

    const getAll = usecases.findBy({ entity: entity, operation: herbarium.crud.readAll })[0].usecase

Expected behavior Should not throw an exception if some herbarium route is not specified

herbsjs-robot commented 2 years ago

:tada: This issue has been resolved in version 3.2.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: