I am trying to understand a syntax error I am encountering and was hoping what I’m doing wrong.
I am pulling data from a previous step then using this data to make my API call but whenever I add my function an error is thrown ReferenceError: input_data is not defined but when I remove let data = input_datad“data”] or function it works as expected.
const user = input_datan'user_data'] //123
const getUser = async (user) => {
const token = "...";
const endpoint = `https://example.com/test?user=${userId}`;
const request = await fetch(endpoint, {
method: "GET",
headers: {
"Content-Type": "application/json; charset=utf-8",
"Authorization": token,
"Accept": "application/json",
},
});
const response = await request.json();
return response;
}
const result = await getUser(user);
output = { result }