a
This commit is contained in:
parent
749f29dbb1
commit
e49cb9741d
@ -102,7 +102,7 @@ async function register(req, res, next) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Comprobamos si el usuario ya existe en nuestro sistema
|
//Comprobamos si el usuario ya existe en nuestro sistema
|
||||||
let newUser = await authService.extraMethods.findUser(values);
|
let newUser = await authService.extraMethods.findUserByPhone(values.phone);
|
||||||
console.log('COMPROBAMOS IS EXISTE EN NUESTRO SISTEMA', newUser);
|
console.log('COMPROBAMOS IS EXISTE EN NUESTRO SISTEMA', newUser);
|
||||||
if (!newUser) {
|
if (!newUser) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -10,6 +10,12 @@ const extraMethods = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
findUserByPhone: async (Phone) => {
|
||||||
|
return await models.User.findOne({
|
||||||
|
where: {phone: Phone},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
createUser: async (params, context) => {
|
createUser: async (params, context) => {
|
||||||
// return models.sequelize.transaction(async transaction => {
|
// return models.sequelize.transaction(async transaction => {
|
||||||
//const result = await models.User.create(params, { transaction });
|
//const result = await models.User.create(params, { transaction });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user