nxus / users

User management module for Nxus apps.
MIT License
0 stars 0 forks source link

error in adminModel registered for users #16

Closed ScottMaxson closed 7 years ago

ScottMaxson commented 8 years ago

I'm seeing the following when trying to run app that has nxus-users: Unhandled rejection TypeError: model is not a function at AdminUI.adminModel (/home/scottm/seabourne/projects/gwli-platform/node_modules/nxus-admin-ui/lib/index.js:378:24) at /home/scottm/seabourne/projects/gwli-platform/node_modules/nxus-core/lib/Dispatcher.js:178:29 at Array.map (native) at /home/scottm/seabourne/projects/gwli-platform/node_modules/nxus-core/lib/Dispatcher.js:177:119

Suspect this line in nxus-users/index.js: app.get('admin-ui').adminModel(__dirname + '/controllers/adminController.js')

?should that be a model and not a controller - if so is it team or user model?

mjreich commented 8 years ago

@ScottMaxson this was actually an issue with an out of date nxus-admin-ui package. Updated to 3.0.0-1 and works as expected (the code was correct in GH, just that the npm package hadn’t been updated)

Though this does raise an API question: adminModel can accept a subclass of AdminBase (which is what nxus-users is doing here). Admittedly, this is poorly named, since you can pass a non-model class as an expected option. Maybe rename this part of it to registerAdminClass or the like?