"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const db_1=require("@b/db"),query_1=require("@b/utils/query"),utils_1=require("./utils");exports.metadata={summary:"Lists all comments with optional inclusion of posts",description:"This endpoint retrieves all available comments along with their associated posts.",operationId:"getComments",tags:["Blog"],requiresAuth:!1,responses:{200:{description:"Comments retrieved successfully",content:{"application/json":{schema:{type:"array",items:{type:"object",properties:{...utils_1.baseCommentSchema,posts:utils_1.commentPostsSchema}}}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("Comments"),500:query_1.serverErrorResponse}};exports.default=async()=>(await db_1.models.comment.findAll({include:{model:db_1.models.user,as:"user",attributes:["id","firstName","lastName","email","avatar"]}})).map(e=>e.get({plain:!0}));