Fix URL for Radarr and other services

This commit is contained in:
Larvey
2022-06-20 14:02:33 -04:00
committed by GitHub
parent 16bcec0deb
commit 35f02a2296

View File

@@ -44,7 +44,10 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
});
}
// Get the origin URL
const { href: origin } = new URL(service.url);
var { href: origin } = new URL(service.url);
if (origin.endsWith("/")) {
origin = origin.slice(0, -1)
}
const pined = `${origin}${url?.url}?apiKey=${service.apiKey}&end=${nextMonth}&start=${lastMonth}`;
const data = await axios.get(
`${origin}${url?.url}?apiKey=${service.apiKey}&end=${nextMonth}&start=${lastMonth}`