feat(servarr): auto fill base url when testing service if missing (#1995)

* feat(servarr): auto fill base url when testing service if missing

This will fill the base URL of the *arr service only if it's missing and the base URL hasn't been
provided beforehand

* fix(servarr): replace redundant check

* fix(servarr): suggested changes
This commit is contained in:
Danshil Kokil Mungur
2021-10-16 19:27:03 +04:00
committed by GitHub
parent 54e9071e90
commit 739f667b54
5 changed files with 59 additions and 0 deletions

View File

@@ -82,6 +82,7 @@ interface TestResponse {
id: number;
label: string;
}[];
urlBase?: string;
}
interface RadarrModalProps {
@@ -317,6 +318,9 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
port: values.port,
useSsl: values.ssl,
});
if (!values.baseUrl || values.baseUrl === '/') {
setFieldValue('baseUrl', testResponse.urlBase);
}
}
}}
secondaryDisabled={