Errant logs
This commit is contained in:
@@ -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) => (
|
||||
|
||||
@@ -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 });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user