Skip to content

Commit

Permalink
minor: don't need to sort firewall rules for create form (#2433)
Browse files Browse the repository at this point in the history
don't need to sort firewall rules for create form
  • Loading branch information
david-crespo authored Sep 11, 2024
1 parent 9c532ce commit 49d6d7d
Showing 1 changed file with 2 additions and 9 deletions.
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

0 comments on commit 49d6d7d

Please sign in to comment.