Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

247
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda