fix(name): default name
parameter on options
object itself
This commit is contained in:
parent
d142e6c553
commit
29ee49fc62
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hapi-sequelize-crud",
|
"name": "hapi-sequelize-crud",
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"description": "Hapi plugin that automatically generates RESTful API for CRUD",
|
"description": "Hapi plugin that automatically generates RESTful API for CRUD",
|
||||||
"main": "build/index.js",
|
"main": "build/index.js",
|
||||||
"config": {
|
"config": {
|
||||||
|
@ -8,9 +8,9 @@ import qs from 'qs';
|
|||||||
|
|
||||||
const register = (server, options = {}, next) => {
|
const register = (server, options = {}, next) => {
|
||||||
options.prefix = options.prefix || '';
|
options.prefix = options.prefix || '';
|
||||||
|
options.name = options.name || 'db';
|
||||||
|
|
||||||
const name = options.name || 'db';
|
const db = server.plugins['hapi-sequelize'][options.name];
|
||||||
const db = server.plugins['hapi-sequelize'][name];
|
|
||||||
const models = db.sequelize.models;
|
const models = db.sequelize.models;
|
||||||
|
|
||||||
const onRequest = function (request, reply) {
|
const onRequest = function (request, reply) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user