'How to Handle Complex Postman URL through Query params

http://localhost:3000/emailgw/gw-config/template/add?active=true& appId=1&bodyText="This template is for testing purpose {{QA_NAME}} and |sr no|Test case|Expected result|actual result|
|--|--|--|--|"&name=Qa_template12&subject"= "TERMINAL_ID is {{TERMINAL_ID}} as on {{DATE}} for MERCHANT {{MERCHANT_NAME}}".*



Solution 1:[1]

The problem is not in the code you are sharing.. Is somewhere else.. My thesis is that you have an asynchronous problem meaning that the data is delivered after the code is executed. In that case the variable is undefined and the conditional statement will return false as in the following example:

let x;

function isOne(input){
  return input === 1;
}

console.log(isOne(x))

Try implementing a promise https://www.w3schools.com/js/js_promise.asp

To see if it's an asynchronous problem you can use setTimeout()

Make sure you have the data and then execute your condition statement. Go step by step checking with console.log()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gass