apps/web: fix show statusCode error
This commit is contained in:
parent
2ec2a14706
commit
540d5642a1
@ -11,13 +11,13 @@ import { dehydrate, QueryClient } from '@tanstack/react-query';
|
||||
import Head from 'next/head';
|
||||
|
||||
export default function Home(props) {
|
||||
if (props.statusCode !== 200) return <Error {...props} />;
|
||||
|
||||
hooks.useSentryScope();
|
||||
hooks.useMainData();
|
||||
hooks.useInsuranceData();
|
||||
hooks.useReactions();
|
||||
|
||||
if (props.statusCode !== 200) return <Error {...props} />;
|
||||
|
||||
return (
|
||||
<Grid>
|
||||
<Head>
|
||||
@ -61,7 +61,10 @@ export const makeGetServerSideProps = ({ roles }) =>
|
||||
|
||||
if (!systemuser?.roles?.some((x) => x?.name && roles.includes(x.name))) {
|
||||
return {
|
||||
props: { statusCode: 403 },
|
||||
props: {
|
||||
initialQueryState: dehydrate(queryClient),
|
||||
statusCode: 403,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -77,6 +80,7 @@ export const makeGetServerSideProps = ({ roles }) =>
|
||||
return {
|
||||
props: {
|
||||
error: JSON.stringify(error),
|
||||
initialQueryState: dehydrate(queryClient),
|
||||
statusCode: 500,
|
||||
},
|
||||
};
|
||||
|
||||
@ -12,14 +12,14 @@ export default function Unlimited(props) {
|
||||
const store = useStore();
|
||||
store.$process.add('Unlimited');
|
||||
|
||||
if (props.statusCode !== 200) return <Error {...props} />;
|
||||
|
||||
hooks.useSentryScope();
|
||||
hooks.useMainData();
|
||||
hooks.useGetUsers();
|
||||
hooks.useInsuranceData();
|
||||
hooks.useReactions();
|
||||
|
||||
if (props.statusCode !== 200) return <Error {...props} />;
|
||||
|
||||
return (
|
||||
<Grid>
|
||||
<Head>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user