"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 author",operationId:"updateAuthor",tags:["Admin","Content","Author"],parameters:[{index:0,name:"id",in:"path",description:"ID of the author to update",required:!0,schema:{type:"string"}}],requestBody:{description:"New data for the author",content:{"application/json":{schema:utils_1.authorUpdateSchema}}},responses:(0,query_1.updateRecordResponses)("Author"),requiresAuth:!0,permission:"edit.blog.author",logModule:"ADMIN_BLOG",logTitle:"Update author"};exports.default=async t=>{const{body:e,params:a,ctx:s}=t,{id:r}=a,{status:u}=e;null==s||s.step("Validating author ID and data");null==s||s.step("Updating author");const o=await(0,query_1.updateRecord)("author",r,{status:u});null==s||s.success("Author updated successfully");return o};