Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
charliepark committed Oct 16, 2024
1 parent 0beea3d commit 874c49b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/forms/idp/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function CreateIdpSideModalForm() {
addToast({
content: (
<>
IDP <HLs>{idp.name}</HLs> created
IdP <HLs>{idp.name}</HLs> created
</>
),
})
Expand Down
11 changes: 10 additions & 1 deletion app/forms/subnet-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {
useCustomRouterItems,
} from '~/components/form/fields/useItemsList'
import { SideModalForm } from '~/components/form/SideModalForm'
import { HLs } from '~/components/HL'
import { useVpcSelector } from '~/hooks/use-params'
import { addToast } from '~/stores/toast'
import { FormDivider } from '~/ui/lib/Divider'
import { pb } from '~/util/path-builder'

Expand All @@ -42,9 +44,16 @@ export function CreateSubnetForm() {
const onDismiss = () => navigate(pb.vpcSubnets(vpcSelector))

const createSubnet = useApiMutation('vpcSubnetCreate', {
onSuccess() {
onSuccess(subnet) {
queryClient.invalidateQueries('vpcSubnetList')
onDismiss()
addToast({
content: (
<>
Subnet <HLs>{subnet.name}</HLs> created
</>
),
})
},
})

Expand Down
13 changes: 4 additions & 9 deletions app/pages/project/vpcs/RouterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
type RouteTarget,
} from '~/api'
import { DocsPopover } from '~/components/DocsPopover'
import { HL, HLs } from '~/components/HL'
import { HL } from '~/components/HL'
import { MoreActionsMenu } from '~/components/MoreActionsMenu'
import { routeFormMessage } from '~/forms/vpc-router-route-common'
import { getVpcRouterSelector, useVpcRouterSelector } from '~/hooks/use-params'
Expand Down Expand Up @@ -88,15 +88,10 @@ export function RouterPage() {
})

const { mutateAsync: deleteRouterRoute } = useApiMutation('vpcRouterRouteDelete', {
onSuccess(_data, variables) {
onSuccess() {
apiQueryClient.invalidateQueries('vpcRouterRouteList')
addToast({
content: (
<>
Route <HLs>{variables.path.route}</HLs> deleted
</>
),
})
// We only have the ID, so will show a generic confirmation message
addToast({ content: 'Route deleted' })
},
})

Expand Down
4 changes: 3 additions & 1 deletion app/pages/project/vpcs/VpcPage/tabs/VpcSubnetsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ export function VpcSubnetsTab() {
const { Table } = useQueryTable('vpcSubnetList', { query: vpcSelector })

const { mutateAsync: deleteSubnet } = useApiMutation('vpcSubnetDelete', {
onSuccess() {
onSuccess(a, b) {
console.log(a, b)
queryClient.invalidateQueries('vpcSubnetList')
// We only have the ID, so will show a generic confirmation message
addToast({ content: 'Subnet deleted' })
},
})
Expand Down
2 changes: 2 additions & 0 deletions app/pages/system/silos/SiloIpPoolsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export function SiloIpPoolsTab() {
const { mutateAsync: unlinkPool } = useApiMutation('ipPoolSiloUnlink', {
onSuccess() {
queryClient.invalidateQueries('siloIpPoolList')
// We only have the ID, so will show a generic confirmation message
addToast({ content: 'IP pool unlinked' })
},
})

Expand Down

0 comments on commit 874c49b

Please sign in to comment.