"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 categories",operationId:"bulkUpdateCategoryStatus",tags:["Admin","Content","Category"],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{ids:{type:"array",description:"Array of category IDs to update",items:{type:"string"}},status:{type:"boolean",description:"New status to apply to the categories (true for active, false for inactive)"}},required:["ids","status"]}}}},responses:(0,query_1.updateRecordResponses)("Category"),requiresAuth:!0,permission:"edit.blog.category",logModule:"ADMIN_BLOG",logTitle:"Bulk update category status"};exports.default=async t=>{const{body:e,ctx:s}=t,{ids:a,status:o}=e;null==s||s.step("Validating category IDs and status");null==s||s.step(`Updating status to ${o?"active":"inactive"} for ${a.length} categories`);const r=await(0,query_1.updateStatus)("category",a,o);null==s||s.success(`${a.length} categories status updated successfully`);return r};