Skip to content

Commit

Permalink
fix(tabstractdatabaseplugin): update controller ctor call and parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Itee committed Aug 12, 2019
1 parent 4761312 commit 5b24e7b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sources/core/plugins/TAbstractDatabasePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ class TAbstractDatabasePlugin {

for ( let index = 0, numberOfDescriptor = descriptors.length ; index < numberOfDescriptor ; index++ ) {

const descriptor = descriptors[ index ]
const controller = new ControllerCtors[ descriptor.controller.name ]( Driver, descriptor.controller.options )
const router = Router( { mergeParams: true } )
const descriptor = descriptors[ index ]
const ControllerClass = ControllerCtors.get( descriptor.controller.name )
const controller = new ControllerClass( { driver: Driver, ...descriptor.controller.options } )
const router = Router( { mergeParams: true } )

console.log( `\tAdd controller for base route: ${descriptor.route}` )
Application.use( descriptor.route, TAbstractDatabasePlugin._populateRouter( router, controller, descriptor.controller.can ) )
Expand Down

0 comments on commit 5b24e7b

Please sign in to comment.