Docs: #cleanup and style fixes

This commit is contained in:
Joey Baker 2016-09-03 18:50:09 -07:00
parent e0132c2cae
commit 85cd2823da

View File

@ -11,6 +11,9 @@ npm install -S hapi-sequelize-crud
##Configure ##Configure
Please note that you should register `hapi-sequelize-crud` after defining your
associations.
```javascript ```javascript
// First, register hapi-sequelize // First, register hapi-sequelize
await register({ await register({
@ -35,6 +38,7 @@ await register({
// `models` property. If you omit this property, all models will have // `models` property. If you omit this property, all models will have
// models defined for them. e.g. // models defined for them. e.g.
models: ['cat', 'dog'] // only the cat and dog models will have routes created models: ['cat', 'dog'] // only the cat and dog models will have routes created
// or // or
models: [ models: [
// possible methods: list, get, scope, create, destroy, destroyAll, destroyScope, update // possible methods: list, get, scope, create, destroy, destroyAll, destroyScope, update
@ -54,18 +58,17 @@ await register({
``` ```
### Methods ### Methods
* list: get all rows in a table * **list**: get all rows in a table
* get: get a single row * **get**: get a single row
* scope: reference a [sequelize scope](http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model) * **scope**: reference a [sequelize scope](http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model)
* create: create a new row * **create**: create a new row
* destroy: delete a row * **destroy**: delete a row
* destroyAll: delete all models in the table * **destroyAll**: delete all models in the table
* destroyScope: use a [sequelize scope](http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model) to find rows, then delete them * **destroyScope**: use a [sequelize scope](http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model) to find rows, then delete them
* update: update a row * **update**: update a row
Please note that you should register `hapi-sequelize-crud` after defining your
associations.
##What do I get ##What do I get