"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:"Updates a specific Slider",operationId:"updateSlider",tags:["Admin","Sliders"],parameters:[{index:0,name:"id",in:"path",description:"ID of the Slider to update",required:!0,schema:{type:"string"}}],requestBody:{description:"New data for the Slider",content:{"application/json":{schema:utils_1.sliderUpdateSchema}}},responses:(0,query_1.updateRecordResponses)("Slider"),requiresAuth:!0,permission:"edit.slider",logModule:"ADMIN_CMS",logTitle:"Update slider"};exports.default=async e=>{const{body:t,params:s,ctx:i}=e,{id:a}=s,{image:r,link:d,status:l}=t;null==i||i.step("Validating slider data");null==i||i.step("Updating slider in database");const u=await(0,query_1.updateRecord)("slider",a,{image:r,link:d,status:l});null==i||i.success("Slider updated successfully");return u};