diff --git a/server/src/routes/announcement.ts b/server/src/routes/announcement.ts index 0137aec..6ccfba5 100644 --- a/server/src/routes/announcement.ts +++ b/server/src/routes/announcement.ts @@ -44,7 +44,7 @@ export const announcementRoutes: FastifyPluginAsync = async(server) => { // eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify requires Body instead of body. server.post<{ Body: { title: string; content: string; type: string } }>( "/announcement", - // eslint-disable-next-line complexity, max-statements -- This is a complex route, but it is necessary to validate the announcement. + // eslint-disable-next-line complexity -- This is a complex route, but it is necessary to validate the announcement. async(request, reply) => { const token = request.headers.authorization; if (token === undefined || token !== process.env.ANNOUNCEMENT_TOKEN) { @@ -73,25 +73,10 @@ export const announcementRoutes: FastifyPluginAsync = async(server) => { }); } - if (title.length < 20) { - return await reply.status(400).send({ - error: - // eslint-disable-next-line stylistic/max-len -- Big boi string. - "Title must be at least 20 characters long so that it may be posted on our forum.", - }); - } - - if (content.length < 50) { - return await reply.status(400).send({ - error: - // eslint-disable-next-line stylistic/max-len -- Big boi string. - "Content must be at least 50 characters long so that it may be posted on our forum.", - }); - } - if (type !== "products" && type !== "community") { return await reply.status(400).send({ - error: "Invalid announcement type.", + error: + "Invalid announcement type. Available types: products, community.", }); }