Skip to content

Commit

Permalink
fix:unauth user access IPAM settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Adekabang authored Nov 27, 2024
1 parent 2181f63 commit 8bdecd1
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions resources/scripts/routers/AdminIpamRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,21 @@ export const routes: Route[] = [
},
{
path: 'addresses',
loader: ({ params }) => {
const id = parseInt(params.poolId!)
const page = params.page ? parseInt(params.page) : 1

return query(getAddressesKey(id, page, ''), () =>
getAddresses(id, {
page,
query: '',
include: ['server'],
})
)
loader: async ({ params }) => {
try {
const id = parseInt(params.poolId!)
const page = params.page ? parseInt(params.page) : 1
const addresses = await query(getAddressesKey(id, page, ''), () =>
getAddresses(id, {
page,
query: '',
include: ['server'],
})
)
return addresses
} catch (error) {
return null
}
},
element: lazyLoad(
lazy(
Expand Down

0 comments on commit 8bdecd1

Please sign in to comment.