generated from nhcarrigan/template
This commit is contained in:
@@ -28,7 +28,14 @@ export const announcementRoutes: FastifyPluginAsync = async(server) => {
|
||||
take: 10,
|
||||
});
|
||||
return await reply.status(200).type("application/json").
|
||||
send(announcements);
|
||||
send(announcements.map((announcement) => {
|
||||
return {
|
||||
content: announcement.content,
|
||||
createdAt: announcement.createdAt,
|
||||
title: announcement.title,
|
||||
type: announcement.type,
|
||||
};
|
||||
}));
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify requires Body instead of body.
|
||||
|
||||
Reference in New Issue
Block a user