Merge pull request #750 from ajnart/fix-ping-status

🐛 Fix StatusCode not being used properly
This commit is contained in:
Thomas Camlong
2023-03-04 08:14:22 +09:00
committed by GitHub
6 changed files with 9 additions and 8 deletions

View File

@@ -10,6 +10,9 @@ interface NetworkTabProps {
export const NetworkTab = ({ form }: NetworkTabProps) => {
const { t } = useTranslation('layout/modals/add-app');
const acceptableStatusCodes = (form.values.network.statusCodes ?? ['200']).map((x) =>
x.toString()
);
return (
<Tabs.Panel value="network" pt="lg">
<Switch
@@ -27,7 +30,7 @@ export const NetworkTab = ({ form }: NetworkTabProps) => {
data={StatusCodes}
clearable
searchable
defaultValue={form.values.network.okStatus.map((x) => `${x}`)}
defaultValue={acceptableStatusCodes}
variant="default"
{...form.getInputProps('network.statusCodes')}
/>

View File

@@ -95,7 +95,7 @@ export const AvailableElementTypes = ({
},
network: {
enabledStatusChecker: true,
okStatus: [200],
statusCodes: ['200'],
},
behaviour: {
isOpeningNewTab: true,