"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query"),utils_1=require("./utils");exports.metadata={summary:"Stores a new Category",operationId:"storeCategory",tags:["Admin","Content","Category"],requestBody:{required:!0,content:{"application/json":{schema:utils_1.categoryUpdateSchema}}},responses:(0,query_1.storeRecordResponses)(utils_1.categoryStoreSchema,"Category"),requiresAuth:!0,permission:"create.blog.category",logModule:"ADMIN_BLOG",logTitle:"Create category"};exports.default=async e=>{const{body:t,ctx:r}=e,{name:a,slug:o,image:s,description:u}=t;null==r||r.step("Validating category data");null==r||r.step("Creating category");const c=await(0,query_1.storeRecord)({model:"category",data:{name:a,slug:o,image:s,description:u}});null==r||r.success("Category created successfully");return c};