"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query");exports.metadata={summary:"Updates the status of an Author",operationId:"updateAuthorStatus",tags:["Admin","Content","Author"],parameters:[{name:"id",in:"path",required:!0,description:"ID of the author to update",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{status:{type:"string",enum:["PENDING","APPROVED","REJECTED"],description:"New status to set for the author"}},required:["status"]}}}},responses:(0,query_1.updateRecordResponses)("Author"),requiresAuth:!0,permission:"edit.blog.author",logModule:"ADMIN_BLOG",logTitle:"Update author status"};exports.default=async t=>{const{body:e,params:s,ctx:a}=t,{id:u}=s,{status:r}=e;null==a||a.step("Validating author ID and status");null==a||a.step(`Updating author status to ${r}`);const o=await(0,query_1.updateStatus)("author",u,r);null==a||a.success("Author status updated successfully");return o};