Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

248
Vistas
Wait for user response before asking next statement - nodejs

I am trying to register on my website via whatsapp but my code and api is running before even im enterring my email and other requirements. i want to ask user for email and wait for user input and adter that i will ask password and so on. after all this the api should run. anyone know whats the error in my code.

else if (lastMsgId && lastMsgId === 'MainMenu' && text == 1) {
        await chat.sendMessage(`Please provide following details to register as seller:`);
        await chat.sendMessage(`Email Id`);
        user['lastMsgId'] = 'Email Id';
        await chat.sendMessage('Username')
        user['username'] = 'Username';
        await chat.sendMessage('Password')
        user['password'] = 'Password';
        await axios.post('mydomain.com/wp-json/wp/v2/users',{
            email: user['lastMsgId'],
            username: user['username'],
            password: user['password'],
            roles: 'Store Vendor'
        })
        .then(function (response) {
            console.log(response);
        })
        .catch(function (error) {
            console.log(error);
        });
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda