Added defaultConfig parameter to the options #2

Merged
Istar-Eldritch merged 2 commits from defaultconfig into master 2016-06-05 17:02:40 +00:00
Istar-Eldritch commented 2016-06-05 13:48:33 +00:00 (Migrated from github.com)

Let the user add a defaultConfig object when initializing the plugin. This object is then used to populate the config parameter of all the routes generated.

This is useful for example to tag all the routes generated by this plugin.

Let the user add a defaultConfig object when initializing the plugin. This object is then used to populate the config parameter of all the routes generated. This is useful for example to tag all the routes generated by this plugin.
mdibaiee commented 2016-06-05 16:47:23 +00:00 (Migrated from github.com)

Hey! Thank you, seems like a good idea. 👍

Do you think we'd better use _.defaultsDeep instead of _.defaults, that way the user won't replace validation rules by adding general rules.

For example:

defaultConfig: {
  validate: {
    params: Joi.array()
  }
}
Hey! Thank you, seems like a good idea. :+1: Do you think we'd better use `_.defaultsDeep` instead of `_.defaults`, that way the user won't replace validation rules by adding general rules. For example: ``` javascript defaultConfig: { validate: { params: Joi.array() } } ```
Istar-Eldritch commented 2016-06-05 16:54:57 +00:00 (Migrated from github.com)

Hi @mdibaiee.

Looks nice, I am not used to work with lodash and I thought that was the default behaviour. 😄

Hi @mdibaiee. Looks nice, I am not used to work with lodash and I thought that was the default behaviour. 😄
mdibaiee commented 2016-06-05 17:02:36 +00:00 (Migrated from github.com)

@Istar-Eldritch Thank you! 😀

@Istar-Eldritch Thank you! 😀
mdibaiee commented 2016-06-05 17:06:46 +00:00 (Migrated from github.com)

Published hapi-sequelize-crud@2.0.11.

Published `hapi-sequelize-crud@2.0.11`. :hand:
Istar-Eldritch commented 2016-06-05 17:16:51 +00:00 (Migrated from github.com)

Thanks, I'm thinking on adding more stuff. But as is going to be more hardcore I'll create first issues to discuss it. 😉

Cheers

Thanks, I'm thinking on adding more stuff. But as is going to be more hardcore I'll create first issues to discuss it. 😉 Cheers
mdibaiee commented 2016-06-05 17:19:08 +00:00 (Migrated from github.com)

@Istar-Eldritch Great! I'm actively maintaining this repository, so no worries at all! ✌️

@Istar-Eldritch Great! I'm actively maintaining this repository, so no worries at all! :v:
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: thereadme/hapi-sequelize-crud#2
No description provided.