How can I get this to return a yes or no if it exists?
const API_KEY = "X",
boardId = X;
const sendRequest = async (payload) => {
const response = await fetch("https://api.monday.com/v2/", {
method: "POST",
body: JSON.stringify(payload),
headers: {
"content-type": "application/json",
authorization: API_KEY,
},
});
const results = await response.json();
return results;
};
const getItem = async () => {
const query = `
query {
items_by_column_values (board_id: ${boardId}, column_id: "email_1", column_value: "${inputData.email}") {
id
name
}
}`;
const response = await sendRequest({
query,
});
const results = response.data,'items_by_column_values']s0].id;
return results;
};
const response = await getItem();
output = {
id: response
};