Errant logs

This commit is contained in:
2024-07-29 00:43:12 +02:00
parent 7d92daeccd
commit 2008888a16
6 changed files with 3 additions and 6 deletions
@@ -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) => (
-2
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 });
},