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

minor: don't need to sort firewall rules for create form #2433

Merged
merged 1 commit into from
Sep 11, 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
11 changes: 2 additions & 9 deletions app/forms/firewall-rules-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
*
* Copyright Oxide Computer Company
*/
import { useMemo } from 'react'
import { useForm } from 'react-hook-form'
import { useNavigate, useParams, type LoaderFunctionArgs } from 'react-router-dom'
import * as R from 'remeda'

import {
apiQueryClient,
Expand Down Expand Up @@ -82,13 +80,8 @@ export function CreateFirewallRuleForm() {
},
})

const { data: vpcFirewallRules } = usePrefetchedApiQuery('vpcFirewallRulesView', {
query: vpcSelector,
})
const existingRules = useMemo(
() => R.sortBy(vpcFirewallRules.rules, (r) => r.priority),
[vpcFirewallRules]
)
const { data } = usePrefetchedApiQuery('vpcFirewallRulesView', { query: vpcSelector })
const existingRules = data.rules

// The :rule path param is optional. If it is present, we are creating a
// rule from an existing one, so we find that rule and copy it into the form
Expand Down
Loading