Post list fixes
This commit is contained in:
@@ -126,7 +126,7 @@ class Post implements JsonSerializable
|
|||||||
$stmt->bindValue(":ID", $this->id);
|
$stmt->bindValue(":ID", $this->id);
|
||||||
try {
|
try {
|
||||||
if (!$stmt->execute()) throw ApiError::failedUpdate(["content"]);
|
if (!$stmt->execute()) throw ApiError::failedUpdate(["content"]);
|
||||||
} catch (Exception) {
|
} catch (Exception $e) {
|
||||||
throw ApiError::failedUpdate(["content"]);
|
throw ApiError::failedUpdate(["content"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+193
File diff suppressed because one or more lines are too long
Vendored
-166
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored
+2
-1
@@ -5,7 +5,8 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/phpCourse/exam/dist/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/phpCourse/exam/dist/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Vite + React + TS</title>
|
<title>Vite + React + TS</title>
|
||||||
<script type="module" crossorigin src="/phpCourse/exam/dist/assets/index-BObjV29d.js"></script>
|
<script type="module" crossorigin src="/phpCourse/exam/dist/assets/index-BJXidBC9.js"></script>
|
||||||
|
<link rel="stylesheet" crossorigin href="/phpCourse/exam/dist/assets/index-D83Ey19k.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -6,19 +6,21 @@ import Api from '../api/Api';
|
|||||||
import Header from '../components/Header/Header';
|
import Header from '../components/Header/Header';
|
||||||
import useGuestBookStore from '../store/store';
|
import useGuestBookStore from '../store/store';
|
||||||
|
|
||||||
export const Route = createRootRouteWithContext<{ queryClient: QueryClient }>()({
|
const Root = () => {
|
||||||
component: () => {
|
//FIXME: REAUTH HERE
|
||||||
//FIXME: REAUTH HERE
|
const token = useGuestBookStore((state) => state.token);
|
||||||
const token = useGuestBookStore((state) => state.token);
|
Api.token = token;
|
||||||
Api.token = token;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header />
|
<Header />
|
||||||
<Toolbar />
|
<Toolbar />
|
||||||
<Outlet />
|
<Outlet />
|
||||||
{process.env.NODE_ENV === 'development' && <TanStackRouterDevtools />}
|
{process.env.NODE_ENV === 'development' && <TanStackRouterDevtools />}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export const Route = createRootRouteWithContext<{ queryClient: QueryClient }>()({
|
||||||
|
component: Root,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ import { TFunction } from 'i18next';
|
|||||||
* @param t Optional translation function, defautls to pass through
|
* @param t Optional translation function, defautls to pass through
|
||||||
* @returns Translated error or inputs if t as unspecified
|
* @returns Translated error or inputs if t as unspecified
|
||||||
*/
|
*/
|
||||||
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
const handleError = (
|
const handleError = (
|
||||||
|
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
error: any,
|
error: any,
|
||||||
context?: string,
|
context?: string,
|
||||||
|
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
t: TFunction<'translation', undefined> | ((..._in: any) => any) = (..._in: any) => _in
|
t: TFunction<'translation', undefined> | ((..._in: any) => any) = (..._in: any) => _in
|
||||||
): string => {
|
): string => {
|
||||||
if (!error) return t('', {});
|
if (!error) return t('', {});
|
||||||
|
|||||||
Reference in New Issue
Block a user