"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query"),utils_1=require("../utils");exports.metadata={summary:"Updates a specific comment",operationId:"updateComment",tags:["Admin","Content","Comment"],parameters:[{index:0,name:"id",in:"path",description:"ID of the comment to update",required:!0,schema:{type:"string"}}],requestBody:{description:"New data for the comment",content:{"application/json":{schema:utils_1.commentUpdateSchema}}},responses:(0,query_1.updateRecordResponses)("Comment"),requiresAuth:!0,permission:"edit.blog.comment",logModule:"ADMIN_BLOG",logTitle:"Update comment"};exports.default=async e=>{const{body:t,params:o,ctx:s}=e,{id:n}=o,{content:a,userId:d,postId:m}=t;null==s||s.step("Validating comment ID and data");null==s||s.step("Updating comment");const r=await(0,query_1.updateRecord)("comment",n,{content:a,userId:d,postId:m});null==s||s.success("Comment updated successfully");return r};