From 8bdecd12692189d4c44665a0ee173ec7b228bc90 Mon Sep 17 00:00:00 2001 From: Mohammad Raska <42745054+Adekabang@users.noreply.github.com> Date: Wed, 27 Nov 2024 02:44:47 -0500 Subject: [PATCH] fix:unauth user access IPAM settings --- resources/scripts/routers/AdminIpamRouter.tsx | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/resources/scripts/routers/AdminIpamRouter.tsx b/resources/scripts/routers/AdminIpamRouter.tsx index 6312e0b08d5..ca22c7a7310 100644 --- a/resources/scripts/routers/AdminIpamRouter.tsx +++ b/resources/scripts/routers/AdminIpamRouter.tsx @@ -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(