refactor: mixin
This commit is contained in:
parent
9b8e39bc3c
commit
3553d6ca8d
|
@ -3,7 +3,7 @@ export const hooks = {
|
|||
// if ('production' === NODE_ENV) {
|
||||
// return;
|
||||
// }
|
||||
const {Project, User} = flecks.get('$flecks/db.models');
|
||||
const {Project, User} = flecks.db.Models;
|
||||
if (!await User.findOne({where: {email: 'persea@cha0s.io'}})) {
|
||||
const user = await User.create({
|
||||
email: 'persea@cha0s.io',
|
||||
|
|
|
@ -24,7 +24,7 @@ export const hooks = {
|
|||
},
|
||||
'@flecks/web/server.request.route': (flecks) => async (req, res, next) => {
|
||||
if (isElectron() && 0 === req.user.id) {
|
||||
const {User} = flecks.get('$flecks/db.models');
|
||||
const {User} = flecks.db.Models;
|
||||
req.logIn(await User.findByPk(1), next);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ export * from './state';
|
|||
export const hooks = {
|
||||
'@flecks/react.roots': () => Persea,
|
||||
'@flecks/redux.effects': (flecks) => {
|
||||
const withSocket = (fn) => (...args) => fn(...args.concat(flecks.get('$flecks/socket.socket')));
|
||||
const withSocket = (fn) => (...args) => fn(...args.concat(flecks.socket.client));
|
||||
return Object.fromEntries(
|
||||
[
|
||||
patchJsonResource,
|
||||
|
|
Loading…
Reference in New Issue
Block a user