diff --git a/README.md b/README.md index 83b1e6c..3aa8af4 100644 --- a/README.md +++ b/README.md @@ -30,16 +30,6 @@ Thank you for your understanding and patience as we work towards making this CLI - **Transaction Support:** Create, Update and Delete routes runs inside [sequelize transaction](https://sequelize.org/docs/v6/other-topics/transactions/) to handle pre/post hooks and rollback automatically in case something failed in the process. - **Secure and Efficient:** Utilizes Sequelize's robust security features and optimized database queries. -## CRUD Routes - -| Operation | URL | Sequelize Operation | Comment | -| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **getList** | Clean:
_GET_ `/`

With pagination:
_GET_ `/?_start=30&_end=60`

With sort & filters:
_GET_ `/?_sort=createdAt&_order=DESC&gender=female` | `findAll()`
or
`findAndCountAll()` | - Enable pagination with `pagination: true` in the config.
- Pagination automatically adds `Content-Range` header.
- Can control which fields can be filterable using `filterableFields` in the config.
- Can control which fields can be sortable using `sortableFieldsFields` in the config. | -| **getOne** | _GET_ `//:resourceId` | `findByPk()` | | -| **create** | _POST_ `/` | `create()` | - Can control which fields can be added to body request using `creatableFields` in the config. | -| **update** | _PUT_ `//:resourceId` | `update()` | - Can control which fields can be added to body request using `updatableFields` in the config. | -| **delete** | _DELETE_ `//:resourceId` | `destroy()` | | - ## Installation Using npm: @@ -124,6 +114,16 @@ app.listen(port, () => { > Check out our [example project](./example) for more features and complex use-cases +## CRUD Routes + +| Operation | URL | Sequelize Operation | Comment | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **getList** | Clean:
_GET_ `/`

With pagination:
_GET_ `/?_start=30&_end=60`

With sort & filters:
_GET_ `/?_sort=createdAt&_order=DESC&gender=female` | `findAll()`
or
`findAndCountAll()` | - Enable pagination with `pagination: true` in the config.
- Pagination automatically adds `Content-Range` header.
- Can control which fields can be filterable using `filterableFields` in the config.
- Can control which fields can be sortable using `sortableFieldsFields` in the config. | +| **getOne** | _GET_ `//:resourceId` | `findByPk()` | | +| **create** | _POST_ `/` | `create()` | - Can control which fields can be added to body request using `creatableFields` in the config. | +| **update** | _PUT_ `//:resourceId` | `update()` | - Can control which fields can be added to body request using `updatableFields` in the config. | +| **delete** | _DELETE_ `//:resourceId` | `destroy()` | | + ## Documentation For detailed usage instructions, examples, and customization options, please refer to our [Documentation](./DOCUMENTATION.md).