style: format with new style
This commit is contained in:
@@ -1,28 +1,32 @@
|
||||
import { fetcher } from "itty-fetcher";
|
||||
import { FeedbackSchema, getFeedbackOption } from "../types/Feedback";
|
||||
import { fetcher } from 'itty-fetcher'
|
||||
import { FeedbackSchema, getFeedbackOption } from '../types/Feedback'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const { message, page, type } = await readValidatedBody(event, FeedbackSchema.parseAsync);
|
||||
const env = useRuntimeConfig(event);
|
||||
const { message, page, type } = await readValidatedBody(
|
||||
event,
|
||||
FeedbackSchema.parseAsync
|
||||
)
|
||||
const env = useRuntimeConfig(event)
|
||||
|
||||
let description = `${message}\n\n`;
|
||||
if (page) description += `**Page:** \`${page}\``;
|
||||
let description = `${message}\n\n`
|
||||
if (page) description += `**Page:** \`${page}\``
|
||||
|
||||
await fetcher()
|
||||
.post(env.WEBHOOK_URL, {
|
||||
username: "Feedback",
|
||||
avatar_url: "https://i.kym-cdn.com/entries/icons/facebook/000/043/403/cover3.jpg",
|
||||
username: 'Feedback',
|
||||
avatar_url:
|
||||
'https://i.kym-cdn.com/entries/icons/facebook/000/043/403/cover3.jpg',
|
||||
embeds: [
|
||||
{
|
||||
color: 3447003,
|
||||
title: getFeedbackOption(type).label,
|
||||
description,
|
||||
},
|
||||
],
|
||||
description
|
||||
}
|
||||
]
|
||||
})
|
||||
.catch((error) => {
|
||||
throw new Error(error);
|
||||
});
|
||||
throw new Error(error)
|
||||
})
|
||||
|
||||
return { status: "ok" };
|
||||
});
|
||||
return { status: 'ok' }
|
||||
})
|
||||
|
@@ -1,3 +1,3 @@
|
||||
export default eventHandler(() => {
|
||||
return { nitro: "works" };
|
||||
});
|
||||
return { nitro: 'works' }
|
||||
})
|
||||
|
Reference in New Issue
Block a user