This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
apps/admin-ui/src/spa/applications/[id] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -824,6 +824,7 @@ function ApplicationDetails({
824824 data,
825825 loading : isLoading ,
826826 refetch,
827+ error,
827828 } = useQuery < Query , QueryApplicationArgs > ( APPLICATION_ADMIN_QUERY , {
828829 skip : applicationPk === 0 ,
829830 variables : { id } ,
@@ -839,6 +840,17 @@ function ApplicationDetails({
839840 return < Loader /> ;
840841 }
841842
843+ if ( error ) {
844+ return < div > { t ( "errors.errorFetchingApplication" ) } </ div > ;
845+ }
846+
847+ // NOTE id query will return null if the application is not found or the user does not have permission
848+ // we can't distinguish between these two cases
849+ const canView = application != null ;
850+ if ( ! canView ) {
851+ return < div > { t ( "errors.noPermission" ) } </ div > ;
852+ }
853+
842854 const isOrganisation = application ?. organisation != null ;
843855
844856 // TODO replace this with an explicit check and warn on undefined fields
You can’t perform that action at this time.
0 commit comments