Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!