This commit is contained in:
taskylizard 2023-11-04 22:17:01 +05:30
parent b21fae6c30
commit e6aecf98a1
No known key found for this signature in database
GPG Key ID: 5CABA3D642DDC497

View File

@ -30,7 +30,7 @@ export default defineEventHandler(async (event) => {
if (!["bug", "suggestion", "other", "appreciate"].includes(feedbackType!) || !message) {
throw new Error("Invalid input.");
}
console.log(env.WEBHOOK_URL);
await fetcher()
.post(env.WEBHOOK_URL, {
username: "Feedback",
@ -43,8 +43,8 @@ export default defineEventHandler(async (event) => {
},
],
})
.catch(({ status, error }) => {
throw new Error(`Error code ${status}: ${error}`);
.catch((error) => {
throw new Error(error);
});
return "success";