Post list fixes

This commit is contained in:
2024-07-25 21:00:34 +02:00
parent bb1e0eebf5
commit 202e89382a
55 changed files with 215 additions and 183 deletions
+16 -14
View File
@@ -6,19 +6,21 @@ import Api from '../api/Api';
import Header from '../components/Header/Header';
import useGuestBookStore from '../store/store';
export const Route = createRootRouteWithContext<{ queryClient: QueryClient }>()({
component: () => {
//FIXME: REAUTH HERE
const token = useGuestBookStore((state) => state.token);
Api.token = token;
const Root = () => {
//FIXME: REAUTH HERE
const token = useGuestBookStore((state) => state.token);
Api.token = token;
return (
<>
<Header />
<Toolbar />
<Outlet />
{process.env.NODE_ENV === 'development' && <TanStackRouterDevtools />}
</>
);
},
return (
<>
<Header />
<Toolbar />
<Outlet />
{process.env.NODE_ENV === 'development' && <TanStackRouterDevtools />}
</>
);
};
export const Route = createRootRouteWithContext<{ queryClient: QueryClient }>()({
component: Root,
});
+2 -1
View File
@@ -7,10 +7,11 @@ import { TFunction } from 'i18next';
* @param t Optional translation function, defautls to pass through
* @returns Translated error or inputs if t as unspecified
*/
//eslint-disable-next-line @typescript-eslint/no-explicit-any
const handleError = (
//eslint-disable-next-line @typescript-eslint/no-explicit-any
error: any,
context?: string,
//eslint-disable-next-line @typescript-eslint/no-explicit-any
t: TFunction<'translation', undefined> | ((..._in: any) => any) = (..._in: any) => _in
): string => {
if (!error) return t('', {});