"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query");exports.metadata={summary:"Bulk updates the status of CMS pages",operationId:"bulkUpdatePageStatus",tags:["Admin","Content","Page"],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{ids:{type:"array",description:"Array of page IDs to update",items:{type:"string"}},status:{type:"string",description:"New status to apply to the pages",enum:["PUBLISHED","DRAFT"]}},required:["ids","status"]}}}},responses:(0,query_1.updateRecordResponses)("Page"),requiresAuth:!0,permission:"edit.page",logModule:"ADMIN_CMS",logTitle:"Bulk update page status"};exports.default=async e=>{const{body:t,ctx:s}=e,{ids:a,status:u}=t;null==s||s.step(`Updating status of ${(null==a?void 0:a.length)||0} page(s) to ${u}`);const p=await(0,query_1.updateStatus)("page",a,u);null==s||s.success("Successfully updated page status");return p};