"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 Author",operationId:"storeAuthor",tags:["Admin","Content","Author"],requestBody:{required:!0,content:{"application/json":{schema:utils_1.authorCreateSchema}}},responses:(0,query_1.storeRecordResponses)(utils_1.authorStoreSchema,"Author"),requiresAuth:!0,permission:"create.blog.author",logModule:"ADMIN_BLOG",logTitle:"Create author"};exports.default=async e=>{const{body:t,ctx:r}=e,{userId:s,status:o}=t;null==r||r.step("Validating author data");null==r||r.step("Creating author");const u=await(0,query_1.storeRecord)({model:"author",data:{userId:s,status:o}});null==r||r.success("Author created successfully");return u};