Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. nuevoCliente: async (root, { input }) => {
  2. const existeCpf = await Cliente.findOne({ cpf: input.cpf });
  3. const existeCorreo = input.correos.map(async correo => {
  4. let prueba = await Cliente.findOne({ correos: [{ correo: correo.correo }]
  5. });
  6. });
  7. console.log(existeCorreo);
  8. if(existeCorreo) {
  9. throw new Error("El correo ya existe intente con otro");
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement