"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 tag",operationId:"updateTag",tags:["Admin","Content","Category"],parameters:[{index:0,name:"id",in:"path",description:"ID of the tag to update",required:!0,schema:{type:"string"}}],requestBody:{description:"New data for the tag",content:{"application/json":{schema:utils_1.tagUpdateSchema}}},responses:(0,query_1.updateRecordResponses)("Tag"),requiresAuth:!0,permission:"edit.blog.tag",logModule:"ADMIN_BLOG",logTitle:"Update tag"};exports.default=async e=>{const{body:t,params:a,ctx:s}=e,{id:r}=a,{name:d,slug:i}=t;null==s||s.step("Validating tag ID and data");null==s||s.step("Updating tag");const u=await(0,query_1.updateRecord)("tag",r,{name:d,slug:i});null==s||s.success("Tag updated successfully");return u};