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