feat: update form logic for new platform
Node.js CI / Lint and Test (push) Successful in 26s

This commit is contained in:
2025-12-10 14:52:36 -08:00
parent 53274ec38c
commit 9d9d0809d7
4 changed files with 41 additions and 30 deletions
+13 -10
View File
@@ -70,7 +70,7 @@ export const instantiateServer = (amari: Amari): void => {
});
server.post<{
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
Body: GithubPayload;
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
Querystring: { secret: string };
@@ -87,16 +87,19 @@ export const instantiateServer = (amari: Amari): void => {
server.
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
post<{ Body: FormSubmission }>("/form", async(request, response) => {
try {
await processFormSubmission(amari, request, response);
} catch (error) {
if (!(error instanceof Error)) {
return;
post<{ Body: Array<FormSubmission>; Querystring: { form: string } }>(
"/form",
async(request, response) => {
try {
await processFormSubmission(amari, request, response);
} catch (error) {
if (!(error instanceof Error)) {
return;
}
await logger.error("/form route", error);
}
await logger.error("/form route", error);
}
});
},
);
server.listen({ port: 7044 }, (error) => {
if (error) {