Errant logs

This commit is contained in:
Kilian Hofmann 2024-07-29 00:43:12 +02:00
parent 7d92daeccd
commit 2008888a16
6 changed files with 3 additions and 6 deletions

File diff suppressed because one or more lines are too long

1
exam/dist/assets/index-CB6IjOSm.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/phpCourse/exam/dist/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<script type="module" crossorigin src="/phpCourse/exam/dist/assets/index-BliQ0crd.js"></script>
<script type="module" crossorigin src="/phpCourse/exam/dist/assets/index-CB6IjOSm.js"></script>
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/react-C_FdcE2X.js">
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/mui-53GMXZgr.js">
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/tanstack-ZGp-Rrdw.js">

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,6 @@ const ErrorComponent: FC<Props> = ({ error, context, color = 'error.main' }) =>
return <Typography color={color}>{t(error.code, { context: `${error.entity}:${context}` })}</Typography>;
case ERRORS.NOT_ALLOWED:
case ERRORS.UNAUTHORIZED:
console.log(error, context);
return <Typography color={color}>{t(error.code, { context })}</Typography>;
case ERRORS.FAILED_UPDATE:
return error.fields.map((field: string, index: number) => (

View File

@ -41,12 +41,10 @@ export const Route = createFileRoute(`${ROUTES.PROFILE}/$id`)({
stringify: ({ id }) => ({ id: id.toString() }),
},
loader: ({ context: { queryClient, Api }, params: { id } }) => {
console.log('LOAD PROFILE');
queryClient.ensureQueryData(profileQueryOptions(Api, id));
queryClient.ensureQueryData(profilePostsQueryOptions(Api, id));
},
beforeLoad: ({ params: { id }, context: { Api } }) => {
console.log('BEFORE PROFILE');
if (!Api.hasAuth) throw redirect({ to: ROUTES.INDEX });
if (id === Api.authenticatedUser?.id) throw redirect({ to: ROUTES.PROFILE });
},