"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 a page",operationId:"updatePageStatus",tags:["Admin","Content","Page"],parameters:[{index:0,name:"id",in:"path",required:!0,description:"ID of the page to update",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{status:{type:"string",description:"New status to apply",enum:["PUBLISHED","DRAFT"]}},required:["status"]}}}},responses:(0,query_1.updateRecordResponses)("Page"),requiresAuth:!0,permission:"edit.page",logModule:"ADMIN_CMS",logTitle:"Update page status"};exports.default=async e=>{const{body:t,params:s,ctx:a}=e,{id:u}=s,{status:p}=t;null==a||a.step(`Updating page status to ${p}`);const r=await(0,query_1.updateStatus)("page",u,p);null==a||a.success("Page status updated successfully");return r};