import{q as i,ag as n,e as o,G as l,H as m,I as c,J as d,ab as s,b}from"./main-D6SjkSWq.js";function g(){const{pathname:t}=i(),a=n(),{getRedirectUri:u}=o();return l({mutationFn:e=>y(e),onSuccess:(e,{albumId:r})=>{c(d("Album deleted")),t.startsWith(`/album/${r}`)&&a(u()),s.invalidateQueries({queryKey:["tracks"]}),s.invalidateQueries({queryKey:["albums"]}),s.invalidateQueries({queryKey:["artists"]})},onError:e=>m(e)})}function y({albumId:t}){return b.delete(`albums/${t}`).then(a=>a.data)}export{g as u};
