refactor!: Frappe handlers using same extensible socketio

This commit is contained in:
Ankush Menat 2024-04-06 18:32:48 +05:30
parent a313fb90cb
commit 4778090024
2 changed files with 2 additions and 6 deletions

View file

@ -1,10 +1,10 @@
const { frappe_request } = require("../utils");
const { frappe_request } = require("./utils");
const log = console.log;
const WEBSITE_ROOM = "website";
const SITE_ROOM = "all";
function frappe_handlers(realtime, socket) {
function frappe_handlers(socket) {
socket.join(user_room(socket.user));
socket.join(WEBSITE_ROOM);

View file

@ -27,11 +27,7 @@ const authenticate = require("./middlewares/authenticate");
realtime.use(authenticate);
// =======================
// load and register handlers
const frappe_handlers = require("./handlers/frappe_handlers");
function on_connection(socket) {
frappe_handlers(realtime, socket);
socket.installed_apps.forEach((app) => {
let app_handler = get_app_handlers(app);
try {