Skip to content

Commit

Permalink
Update limit values to 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
charliepark committed Sep 9, 2024
1 parent 9e400d5 commit f5f2964
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
5 changes: 2 additions & 3 deletions app/forms/firewall-rules-common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { RadioField } from '~/components/form/fields/RadioField'
import { TextField, TextFieldInner } from '~/components/form/fields/TextField'
import { useVpcSelector } from '~/hooks'
import { useForm } from '~/hooks/use-form'
import { PAGE_SIZE } from '~/table/QueryTable'
import { Badge } from '~/ui/lib/Badge'
import { Button } from '~/ui/lib/Button'
import { FormDivider } from '~/ui/lib/Divider'
Expand Down Expand Up @@ -270,12 +269,12 @@ export const CommonFields = ({ control, nameTaken, error }: CommonFieldsProps) =
const {
data: { items: instances },
} = usePrefetchedApiQuery('instanceList', {
query: { project, limit: PAGE_SIZE },
query: { project, limit: 1000 },
})
const {
data: { items: vpcs },
} = usePrefetchedApiQuery('vpcList', {
query: { project, limit: PAGE_SIZE },
query: { project, limit: 1000 },
})
const {
data: { items: vpcSubnets },
Expand Down
11 changes: 3 additions & 8 deletions app/forms/firewall-rules-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
import { SideModalForm } from '~/components/form/SideModalForm'
import { getVpcSelector, useForm, useVpcSelector } from '~/hooks'
import { addToast } from '~/stores/toast'
import { PAGE_SIZE } from '~/table/QueryTable'
import { pb } from '~/util/path-builder'

import { CommonFields } from './firewall-rules-common'
Expand Down Expand Up @@ -58,13 +57,9 @@ const ruleToValues = (rule: VpcFirewallRule): FirewallRuleValues => ({
CreateFirewallRuleForm.loader = async ({ params }: LoaderFunctionArgs) => {
const { project, vpc } = getVpcSelector(params)
await Promise.all([
apiQueryClient.prefetchQuery('vpcFirewallRulesView', {
query: getVpcSelector(params),
}),
apiQueryClient.prefetchQuery('instanceList', {
query: { project, limit: PAGE_SIZE },
}),
apiQueryClient.prefetchQuery('vpcList', { query: { project, limit: PAGE_SIZE } }),
apiQueryClient.prefetchQuery('vpcFirewallRulesView', { query: { project, vpc } }),
apiQueryClient.prefetchQuery('instanceList', { query: { project, limit: 1000 } }),
apiQueryClient.prefetchQuery('vpcList', { query: { project, limit: 1000 } }),
apiQueryClient.prefetchQuery('vpcSubnetList', { query: { project, vpc } }),
])

Expand Down
9 changes: 3 additions & 6 deletions app/forms/firewall-rules-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
useForm,
useVpcSelector,
} from '~/hooks'
import { PAGE_SIZE } from '~/table/QueryTable'
import { invariant } from '~/util/invariant'
import { pb } from '~/util/path-builder'

Expand All @@ -34,11 +33,9 @@ EditFirewallRuleForm.loader = async ({ params }: LoaderFunctionArgs) => {
const { project, vpc, rule } = getFirewallRuleSelector(params)

const [firewallRules] = await Promise.all([
apiQueryClient.fetchQuery('vpcFirewallRulesView', {
query: { project, vpc },
}),
apiQueryClient.prefetchQuery('instanceList', { query: { project, limit: PAGE_SIZE } }),
apiQueryClient.prefetchQuery('vpcList', { query: { project, limit: PAGE_SIZE } }),
apiQueryClient.fetchQuery('vpcFirewallRulesView', { query: { project, vpc } }),
apiQueryClient.prefetchQuery('instanceList', { query: { project, limit: 1000 } }),
apiQueryClient.prefetchQuery('vpcList', { query: { project, limit: 1000 } }),
apiQueryClient.prefetchQuery('vpcSubnetList', { query: { project, vpc } }),
])

Expand Down

0 comments on commit f5f2964

Please sign in to comment.