"use strict";async function deleteWatchlist(e){await db_1.models.exchangeWatchlist.destroy({where:{id:e}})}Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;exports.deleteWatchlist=deleteWatchlist;const db_1=require("@b/db"),query_1=require("@b/utils/query");exports.metadata={summary:"Remove Item from Watchlist",operationId:"removeWatchlistItem",tags:["Exchange","Watchlist"],description:"Removes an item from the watchlist for the authenticated user.",parameters:[{name:"id",in:"path",required:!0,description:"ID of the watchlist item to remove.",schema:{type:"number"}}],responses:(0,query_1.deleteRecordResponses)("Watchlist"),requiresAuth:!0,logModule:"EXCHANGE",logTitle:"Remove watchlist item"};exports.default=async e=>{const{ctx:t}=e;null==t||t.step("Fetching watchlist item details");const s=await db_1.models.exchangeWatchlist.findByPk(Number(e.params.id));null==t||t.step("Removing watchlist item");await deleteWatchlist(Number(e.params.id));null==t||t.success("Removed watchlist item"+(s?`: ${s.symbol}`:""))};