🚑 Fix API url for services

This commit is contained in:
ajnart
2022-05-21 01:26:55 +02:00
parent c3b11be2d0
commit bfb26a9402

View File

@@ -34,7 +34,7 @@ export default function CalendarComponent(props: any) {
if (sonarrService && sonarrService.apiKey) { if (sonarrService && sonarrService.apiKey) {
const baseUrl = new URL(sonarrService.url).origin; const baseUrl = new URL(sonarrService.url).origin;
fetch( fetch(
`${baseUrl}api/calendar?apikey=${sonarrService?.apiKey}&end=${nextMonth}` `${baseUrl}/api/calendar?apikey=${sonarrService?.apiKey}&end=${nextMonth}`
).then((response) => { ).then((response) => {
response.ok && response.ok &&
response.json().then((data) => { response.json().then((data) => {
@@ -52,7 +52,7 @@ export default function CalendarComponent(props: any) {
} }
if (radarrService && radarrService.apiKey) { if (radarrService && radarrService.apiKey) {
const baseUrl = new URL(radarrService.url).origin; const baseUrl = new URL(radarrService.url).origin;
fetch(`${baseUrl}api/v3/calendar?apikey=${radarrService?.apiKey}&end=${nextMonth}`).then( fetch(`${baseUrl}/api/v3/calendar?apikey=${radarrService?.apiKey}&end=${nextMonth}`).then(
(response) => { (response) => {
response.ok && response.ok &&
response.json().then((data) => { response.json().then((data) => {