Post list fixes
This commit is contained in:
@@ -126,7 +126,7 @@ class Post implements JsonSerializable
|
||||
$stmt->bindValue(":ID", $this->id);
|
||||
try {
|
||||
if (!$stmt->execute()) throw ApiError::failedUpdate(["content"]);
|
||||
} catch (Exception) {
|
||||
} catch (Exception $e) {
|
||||
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" />
|
||||
<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-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>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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('', {});
|
||||
|
||||
Reference in New Issue
Block a user