The post API is returning result undefined

For starters you are not handling the returned error from the fetch. the .catch does not return anything.

Secondly i believe the response is actually a html response so a text response not a JSON response. you are trying to get the response as JSON. Your better off checking that the status in the httpResponse is a 200 OK to decide if it went through

export function getcertificate() {
let endPoint =
https://docs.google.com/forms/u/0/d/e/1FAIpQLSemY58g-nMoFe9KfetmJLGGYnTeMbfQJgyhR9RDhNr5iEI30A/formResponse”;
let name = “Test User Name”;
let email = “testuser@email.com”;
let profile = “testuser”;
return fetch(endPoint, {
method: “post”,
headers: {
“Content-Type”: “application/x-www-form-urlencoded”,
},
body: JSON.stringify({
“entry.575833505”: name,
“entry.1168209987”: email,
“entry.1027774066”: profile,
}),
})
.then((httpResponse) => {
if (httpResponse.ok) {
return { success: true };
} else {
return Promise.reject(“Fetch did not succeed”);
}
})
.catch((err) => {
return { success: false, error: Error with submission: ${String(err)} };
});
}

export async function getcert_click(event) {
var resp = await getcertificate();
if (resp.success) {
console.log(‘Submission successful, status 200 OK’)
} else {
console.error('Submission failed; ', resp.error)
}
}