"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 Blog Post",operationId:"storePost",tags:["Admin","Content","Posts"],requestBody:{required:!0,content:{"application/json":{schema:utils_1.postUpdateSchema}}},responses:(0,query_1.storeRecordResponses)(utils_1.postStoreSchema,"Blog Post"),requiresAuth:!0,permission:"create.blog.post",logModule:"ADMIN_BLOG",logTitle:"Create blog post"};exports.default=async t=>{const{body:e,ctx:s}=t,{title:o,content:r,categoryId:a,authorId:l,slug:u,description:i,status:n,image:c}=e;null==s||s.step("Validating blog post data");null==s||s.step("Creating blog post");const d=await(0,query_1.storeRecord)({model:"post",data:{title:o,content:r,categoryId:a,authorId:l,slug:u,description:i,status:n,image:c}});null==s||s.success("Blog post created successfully");return d};