mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Update brewery post services, transactional emails
This commit is contained in:
@@ -7,7 +7,7 @@ import { FC } from 'react';
|
||||
import { z } from 'zod';
|
||||
import withPageAuthRequired from '@/util/withPageAuthRequired';
|
||||
import UserHeader from '@/components/UserPage/UserHeader';
|
||||
import { findUserById } from '@/services/users/auth';
|
||||
import { findUserByIdService } from '@/services/users/auth';
|
||||
|
||||
interface UserInfoPageProps {
|
||||
user: z.infer<typeof GetUserSchema>;
|
||||
@@ -40,7 +40,7 @@ export default UserInfoPage;
|
||||
export const getServerSideProps = withPageAuthRequired<UserInfoPageProps>(
|
||||
async (context) => {
|
||||
const { id } = context.params!;
|
||||
const user = await findUserById({ userId: id as string });
|
||||
const user = await findUserByIdService({ userId: id as string });
|
||||
return user
|
||||
? { props: { user: JSON.parse(JSON.stringify(user)) } }
|
||||
: { notFound: true };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { setLoginSession } from '@/config/auth/session';
|
||||
import { verifyResetPasswordToken } from '@/config/jwt';
|
||||
import ServerError from '@/config/util/ServerError';
|
||||
import { findUserById } from '@/services/users/auth';
|
||||
import { findUserByIdService } from '@/services/users/auth';
|
||||
|
||||
import { GetServerSideProps, NextApiResponse, NextPage } from 'next';
|
||||
|
||||
@@ -29,7 +29,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
|
||||
|
||||
const { id } = await verifyResetPasswordToken(token as string);
|
||||
|
||||
const user = await findUserById({ userId: id as string });
|
||||
const user = await findUserByIdService({ userId: id as string });
|
||||
if (!user) {
|
||||
throw new ServerError('User not found', 404);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user