transfer project in github

This commit is contained in:
hamid.zarghami1@gmail.com
2024-05-12 15:29:27 +03:30
commit e644edbd65
348 changed files with 164991 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
const Order = require('../models/Order')
module.exports.initAdmin = async () => {
try {
global.adminIo = io.of('/admin')
// admins middlewares1
// admin.use(isAdmin)
// attach events
adminIo.on('connection', socket => {
console.log('admin connected')
/// /////////////////////////////////////////////////////// handle connection error
socket.on('connect_error', err => {
console.log(err.message)
})
})
}catch (e) {
console.log(e.message)
}
}
module.exports.sendNotifyOrder = async (branchId) => {
try {
adminIo.emit('order' , {branchId})
}catch (e) {
console.log(e.message)
}
}