From 3553d6ca8d37560ba8ad2368da2c44369057cebe Mon Sep 17 00:00:00 2001 From: cha0s Date: Fri, 5 Jan 2024 19:26:41 -0600 Subject: [PATCH] refactor: mixin --- packages/bootstrap/src/server.js | 2 +- packages/core/src/electron/server.js | 2 +- packages/core/src/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bootstrap/src/server.js b/packages/bootstrap/src/server.js index c33c0bf..727bfbf 100644 --- a/packages/bootstrap/src/server.js +++ b/packages/bootstrap/src/server.js @@ -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', diff --git a/packages/core/src/electron/server.js b/packages/core/src/electron/server.js index 6af135a..ff3f331 100644 --- a/packages/core/src/electron/server.js +++ b/packages/core/src/electron/server.js @@ -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; } diff --git a/packages/core/src/index.js b/packages/core/src/index.js index c36b82e..13c5342 100644 --- a/packages/core/src/index.js +++ b/packages/core/src/index.js @@ -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,