"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 Slider",operationId:"storeSlider",tags:["Admin","Sliders"],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:utils_1.sliderSchema,required:["image"]}}}},responses:(0,query_1.storeRecordResponses)(utils_1.sliderSchema,"Slider"),requiresAuth:!0,permission:"create.slider",logModule:"ADMIN_CMS",logTitle:"Create slider"};exports.default=async e=>{const{body:s,ctx:r}=e,{image:t,link:i,status:l}=s;null==r||r.step("Validating slider data");null==r||r.step("Creating slider");const a=await(0,query_1.storeRecord)({model:"slider",data:{image:t,link:i,status:l},returnResponse:!0});null==r||r.success("Slider created successfully");return a};