Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG FIX] fix bug where form didn't include off Switches #41

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions server/app/query/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ function IPAForm({
<Switch
checked={stallDetectionEnabled}
onChange={setStallDetectionEnabled}
name="stall_detection"
className={`${
stallDetectionEnabled ? "bg-blue-600" : "bg-gray-200"
} relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`}
Expand All @@ -360,6 +359,12 @@ function IPAForm({
} inline-block h-4 w-4 transform rounded-full bg-white transition-transform`}
/>
</Switch>
{/* Hidden input to ensure the field is always included in the form data */}
<input
type="hidden"
name="stall_detection"
value={stallDetectionEnabled.toString()}
/>
</div>
</div>

Expand All @@ -371,7 +376,6 @@ function IPAForm({
<Switch
checked={multiThreadingEnabled}
onChange={setMultiThreadingEnabled}
name="multi_threading"
className={`${
multiThreadingEnabled ? "bg-blue-600" : "bg-gray-200"
} relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`}
Expand All @@ -382,6 +386,11 @@ function IPAForm({
} inline-block h-4 w-4 transform rounded-full bg-white transition-transform`}
/>
</Switch>
<input
type="hidden"
name="multi_threading"
value={multiThreadingEnabled.toString()}
/>
</div>
</div>

Expand All @@ -393,7 +402,6 @@ function IPAForm({
<Switch
checked={disableMetricsEnabled}
onChange={setDisableMetricsEnabled}
name="disable_metrics"
className={`${
disableMetricsEnabled ? "bg-blue-600" : "bg-gray-200"
} relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`}
Expand All @@ -404,6 +412,11 @@ function IPAForm({
} inline-block h-4 w-4 transform rounded-full bg-white transition-transform`}
/>
</Switch>
<input
type="hidden"
name="disable_metrics"
value={disableMetricsEnabled.toString()}
/>
</div>
</div>

Expand Down
Loading