mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Fix beer likes and db client
This commit is contained in:
16
pages/account/index.tsx
Normal file
16
pages/account/index.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import Layout from '@/components/ui/Layout';
|
||||
import { NextPage } from 'next';
|
||||
|
||||
interface AccountPageProps {}
|
||||
|
||||
const AccountPage: NextPage<AccountPageProps> = () => {
|
||||
return (
|
||||
<Layout>
|
||||
<div>
|
||||
<h1>Account Page</h1>
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
};
|
||||
|
||||
export default AccountPage;
|
||||
@@ -24,7 +24,7 @@ const sendLikeRequest = async (
|
||||
throw new ServerError('Could not find a beer post with that id', 404);
|
||||
}
|
||||
|
||||
const alreadyLiked = await findBeerPostLikeById(id);
|
||||
const alreadyLiked = await findBeerPostLikeById(beer.id, user.id);
|
||||
|
||||
const jsonResponse = {
|
||||
success: true as const,
|
||||
@@ -50,11 +50,7 @@ const router = createRouter<
|
||||
|
||||
router.post(
|
||||
getCurrentUser,
|
||||
validateRequest({
|
||||
querySchema: z.object({
|
||||
id: z.string().uuid(),
|
||||
}),
|
||||
}),
|
||||
validateRequest({ querySchema: z.object({ id: z.string().uuid() }) }),
|
||||
sendLikeRequest,
|
||||
);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ const LogoutPage: NextPage = () => {
|
||||
router.reload();
|
||||
router.push('/');
|
||||
}, [router]);
|
||||
return <div />;
|
||||
return null;
|
||||
};
|
||||
|
||||
export default LogoutPage;
|
||||
|
||||
Reference in New Issue
Block a user