1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
letu/sockets/get/userGet.js

17 lines
533 B
JavaScript

const models = require("../../models");
module.exports = socket => {
return async (data) => {
let options = {where: {}};
if (data.email)
options.where.email = data.email;
if (data.firstName && data.lastName) {
options.where.firstName = data.firstName;
options.where.lastName = data.lastName;
}
if (data.permissions)
options.where.permissions = data.permissions;
socket.emit("userGet", await models.User.findAll(options));
}
};