Merge pull request #250 from LarveyOfficial/patch-2

🐛Fix URL for Radarr and other services
This commit is contained in:
Thomas Camlong
2022-06-20 20:14:17 +02:00
committed by GitHub

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}`