mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Update casing for services and controllers directories.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import validateEmailRequest from '@/requests/User/validateEmailRequest';
|
import validateEmailRequest from '@/requests/User/validateEmailRequest';
|
||||||
import validateUsernameRequest from '@/requests/validateUsernameRequest';
|
import validateUsernameRequest from '@/requests/validateUsernameRequest';
|
||||||
import { BaseCreateUserSchema } from '@/services/users/User/schema/CreateUserValidationSchemas';
|
import { BaseCreateUserSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas';
|
||||||
import { Switch } from '@headlessui/react';
|
import { Switch } from '@headlessui/react';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { Dispatch, FC, useContext } from 'react';
|
import { Dispatch, FC, useContext } from 'react';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Dispatch, FunctionComponent } from 'react';
|
|||||||
import { SubmitHandler, useForm } from 'react-hook-form';
|
import { SubmitHandler, useForm } from 'react-hook-form';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { UpdatePasswordSchema } from '@/services/users/User/schema/CreateUserValidationSchemas';
|
import { UpdatePasswordSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas';
|
||||||
import sendUpdatePasswordRequest from '@/requests/User/sendUpdatePasswordRequest';
|
import sendUpdatePasswordRequest from '@/requests/User/sendUpdatePasswordRequest';
|
||||||
import { AccountPageState, AccountPageAction } from '@/reducers/accountPageReducer';
|
import { AccountPageState, AccountPageAction } from '@/reducers/accountPageReducer';
|
||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import FormSegment from '@/components/ui/forms/FormSegment';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import FormTextArea from '@/components/ui/forms/FormTextArea';
|
import FormTextArea from '@/components/ui/forms/FormTextArea';
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
import GetUserSchema from '@/services/users/auth/schema/GetUserSchema';
|
||||||
import type {
|
import type {
|
||||||
UseFormHandleSubmit,
|
UseFormHandleSubmit,
|
||||||
SubmitHandler,
|
SubmitHandler,
|
||||||
@@ -13,7 +13,7 @@ import type {
|
|||||||
UseFormRegister,
|
UseFormRegister,
|
||||||
} from 'react-hook-form';
|
} from 'react-hook-form';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import UpdateProfileSchema from '../../services/users/User/schema/UpdateProfileSchema';
|
import UpdateProfileSchema from '@/services/users/auth/schema/UpdateProfileSchema';
|
||||||
|
|
||||||
type UpdateProfileSchemaT = z.infer<typeof UpdateProfileSchema>;
|
type UpdateProfileSchemaT = z.infer<typeof UpdateProfileSchema>;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
import { CldImage } from 'next-cloudinary';
|
import { CldImage } from 'next-cloudinary';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
import GetUserSchema from '@/services/users/auth/schema/GetUserSchema';
|
||||||
import { FaUser } from 'react-icons/fa';
|
import { FaUser } from 'react-icons/fa';
|
||||||
|
|
||||||
interface UserAvatarProps {
|
interface UserAvatarProps {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import sendCreateBeerCommentRequest from '@/requests/BeerComment/sendCreateBeerCommentRequest';
|
import sendCreateBeerCommentRequest from '@/requests/BeerComment/sendCreateBeerCommentRequest';
|
||||||
|
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
|
|
||||||
import { FunctionComponent } from 'react';
|
import { FunctionComponent } from 'react';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { FC, useContext } from 'react';
|
|||||||
|
|
||||||
import UserContext from '@/contexts/UserContext';
|
import UserContext from '@/contexts/UserContext';
|
||||||
import { FaRegEdit } from 'react-icons/fa';
|
import { FaRegEdit } from 'react-icons/fa';
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import useGetBeerPostLikeCount from '@/hooks/data-fetching/beer-likes/useBeerPostLikeCount';
|
import useGetBeerPostLikeCount from '@/hooks/data-fetching/beer-likes/useBeerPostLikeCount';
|
||||||
import useTimeDistance from '@/hooks/utilities/useTimeDistance';
|
import useTimeDistance from '@/hooks/utilities/useTimeDistance';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import UserContext from '@/contexts/UserContext';
|
import UserContext from '@/contexts/UserContext';
|
||||||
|
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
|
|
||||||
import { FC, MutableRefObject, useContext, useRef } from 'react';
|
import { FC, MutableRefObject, useContext, useRef } from 'react';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { FC, MutableRefObject, useRef } from 'react';
|
|||||||
import { useInView } from 'react-intersection-observer';
|
import { useInView } from 'react-intersection-observer';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import useBeerRecommendations from '@/hooks/data-fetching/beer-posts/useBeerRecommendations';
|
import useBeerRecommendations from '@/hooks/data-fetching/beer-posts/useBeerRecommendations';
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import debounce from 'lodash/debounce';
|
import debounce from 'lodash/debounce';
|
||||||
import BeerRecommendationLoadingComponent from './BeerRecommendationLoadingComponent';
|
import BeerRecommendationLoadingComponent from './BeerRecommendationLoadingComponent';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { FC, useContext } from 'react';
|
import { FC, useContext } from 'react';
|
||||||
|
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import UserContext from '@/contexts/UserContext';
|
import UserContext from '@/contexts/UserContext';
|
||||||
import useGetBeerPostLikeCount from '@/hooks/data-fetching/beer-likes/useBeerPostLikeCount';
|
import useGetBeerPostLikeCount from '@/hooks/data-fetching/beer-likes/useBeerPostLikeCount';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { FC, MutableRefObject, useRef } from 'react';
|
|||||||
import { useInView } from 'react-intersection-observer';
|
import { useInView } from 'react-intersection-observer';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult';
|
import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult';
|
||||||
import useBeerPostsByBeerStyle from '@/hooks/data-fetching/beer-posts/useBeerPostsByBeerStyles';
|
import useBeerPostsByBeerStyle from '@/hooks/data-fetching/beer-posts/useBeerPostsByBeerStyles';
|
||||||
import BeerRecommendationLoadingComponent from '../BeerById/BeerRecommendationLoadingComponent';
|
import BeerRecommendationLoadingComponent from '../BeerById/BeerRecommendationLoadingComponent';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import CreateCommentValidationSchema from '@/services/schema/CommentSchema/Creat
|
|||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
import createErrorToast from '@/util/createErrorToast';
|
import createErrorToast from '@/util/createErrorToast';
|
||||||
|
|
||||||
import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult';
|
import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult';
|
||||||
import useBeerStyleComments from '@/hooks/data-fetching/beer-style-comments/useBeerStyleComments';
|
import useBeerStyleComments from '@/hooks/data-fetching/beer-style-comments/useBeerStyleComments';
|
||||||
import sendCreateBeerStyleCommentRequest from '@/requests/BeerStyleComment/sendCreateBeerStyleCommentRequest';
|
import sendCreateBeerStyleCommentRequest from '@/requests/BeerStyleComment/sendCreateBeerStyleCommentRequest';
|
||||||
import CommentForm from '../ui/CommentForm';
|
import CommentForm from '../ui/CommentForm';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
|||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
||||||
|
|
||||||
import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult';
|
import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult';
|
||||||
import useBeerStyleComments from '@/hooks/data-fetching/beer-style-comments/useBeerStyleComments';
|
import useBeerStyleComments from '@/hooks/data-fetching/beer-style-comments/useBeerStyleComments';
|
||||||
import LoadingComponent from '../BeerById/LoadingComponent';
|
import LoadingComponent from '../BeerById/LoadingComponent';
|
||||||
import CommentsComponent from '../ui/CommentsComponent';
|
import CommentsComponent from '../ui/CommentsComponent';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { FaRegEdit } from 'react-icons/fa';
|
|||||||
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import useTimeDistance from '@/hooks/utilities/useTimeDistance';
|
import useTimeDistance from '@/hooks/utilities/useTimeDistance';
|
||||||
import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult';
|
import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult';
|
||||||
import useBeerStyleLikeCount from '@/hooks/data-fetching/beer-style-likes/useBeerStyleLikeCount';
|
import useBeerStyleLikeCount from '@/hooks/data-fetching/beer-style-likes/useBeerStyleLikeCount';
|
||||||
import BeerStyleLikeButton from './BeerStyleLikeButton';
|
import BeerStyleLikeButton from './BeerStyleLikeButton';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult';
|
import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import UseBeerPostsByBrewery from '@/hooks/data-fetching/beer-posts/useBeerPostsByBrewery';
|
import UseBeerPostsByBrewery from '@/hooks/data-fetching/beer-posts/useBeerPostsByBrewery';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { FC, MutableRefObject, useContext, useRef } from 'react';
|
import { FC, MutableRefObject, useContext, useRef } from 'react';
|
||||||
import { useInView } from 'react-intersection-observer';
|
import { useInView } from 'react-intersection-observer';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import useBreweryPostComments from '@/hooks/data-fetching/brewery-comments/useBreweryPostComments';
|
import useBreweryPostComments from '@/hooks/data-fetching/brewery-comments/useBreweryPostComments';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import UserContext from '@/contexts/UserContext';
|
import UserContext from '@/contexts/UserContext';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import { FC, MutableRefObject, useContext, useRef } from 'react';
|
import { FC, MutableRefObject, useContext, useRef } from 'react';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import UserContext from '@/contexts/UserContext';
|
import UserContext from '@/contexts/UserContext';
|
||||||
import useGetBreweryPostLikeCount from '@/hooks/data-fetching/brewery-likes/useGetBreweryPostLikeCount';
|
import useGetBreweryPostLikeCount from '@/hooks/data-fetching/brewery-likes/useGetBreweryPostLikeCount';
|
||||||
import useTimeDistance from '@/hooks/utilities/useTimeDistance';
|
import useTimeDistance from '@/hooks/utilities/useTimeDistance';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import { FC, useContext } from 'react';
|
import { FC, useContext } from 'react';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import UserContext from '@/contexts/UserContext';
|
import UserContext from '@/contexts/UserContext';
|
||||||
import useGetBreweryPostLikeCount from '@/hooks/data-fetching/brewery-likes/useGetBreweryPostLikeCount';
|
import useGetBreweryPostLikeCount from '@/hooks/data-fetching/brewery-likes/useGetBreweryPostLikeCount';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import { FC, useContext } from 'react';
|
import { FC, useContext } from 'react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import sendUploadBreweryImagesRequest from '@/requests/BreweryImage/sendUploadBreweryImageRequest';
|
import sendUploadBreweryImagesRequest from '@/requests/BreweryImage/sendUploadBreweryImageRequest';
|
||||||
import sendCreateBreweryPostRequest from '@/requests/BreweryPost/sendCreateBreweryPostRequest';
|
import sendCreateBreweryPostRequest from '@/requests/BreweryPost/sendCreateBreweryPostRequest';
|
||||||
import CreateBreweryPostSchema from '@/services/posts/BreweryPost/schema/CreateBreweryPostSchema';
|
import CreateBreweryPostSchema from '@/services/posts/brewery-post/schema/CreateBreweryPostSchema';
|
||||||
import UploadImageValidationSchema from '@/services/schema/ImageSchema/UploadImageValidationSchema';
|
import UploadImageValidationSchema from '@/services/schema/ImageSchema/UploadImageValidationSchema';
|
||||||
import createErrorToast from '@/util/createErrorToast';
|
import createErrorToast from '@/util/createErrorToast';
|
||||||
import { Tab } from '@headlessui/react';
|
import { Tab } from '@headlessui/react';
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import router from 'next/router';
|
|||||||
import { FunctionComponent } from 'react';
|
import { FunctionComponent } from 'react';
|
||||||
import { useForm, SubmitHandler, FieldError } from 'react-hook-form';
|
import { useForm, SubmitHandler, FieldError } from 'react-hook-form';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import CreateBeerPostValidationSchema from '@/services/posts/BeerPost/schema/CreateBeerPostValidationSchema';
|
import CreateBeerPostValidationSchema from '@/services/posts/beer-post/schema/CreateBeerPostValidationSchema';
|
||||||
import sendCreateBeerPostRequest from '@/requests/BeerPost/sendCreateBeerPostRequest';
|
import sendCreateBeerPostRequest from '@/requests/BeerPost/sendCreateBeerPostRequest';
|
||||||
import UploadImageValidationSchema from '@/services/schema/ImageSchema/UploadImageValidationSchema';
|
import UploadImageValidationSchema from '@/services/schema/ImageSchema/UploadImageValidationSchema';
|
||||||
import sendUploadBeerImagesRequest from '@/requests/BeerImage/sendUploadBeerImageRequest';
|
import sendUploadBeerImagesRequest from '@/requests/BeerImage/sendUploadBeerImageRequest';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { useForm, SubmitHandler } from 'react-hook-form';
|
|||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
|
|
||||||
import deleteBeerPostRequest from '@/requests/BeerPost/deleteBeerPostRequest';
|
import deleteBeerPostRequest from '@/requests/BeerPost/deleteBeerPostRequest';
|
||||||
import EditBeerPostValidationSchema from '@/services/posts/BeerPost/schema/EditBeerPostValidationSchema';
|
import EditBeerPostValidationSchema from '@/services/posts/beer-post/schema/EditBeerPostValidationSchema';
|
||||||
import sendEditBeerPostRequest from '@/requests/BeerPost/sendEditBeerPostRequest';
|
import sendEditBeerPostRequest from '@/requests/BeerPost/sendEditBeerPostRequest';
|
||||||
import createErrorToast from '@/util/createErrorToast';
|
import createErrorToast from '@/util/createErrorToast';
|
||||||
import Button from './ui/forms/Button';
|
import Button from './ui/forms/Button';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import sendLoginUserRequest from '@/requests/User/sendLoginUserRequest';
|
import sendLoginUserRequest from '@/requests/User/sendLoginUserRequest';
|
||||||
import LoginValidationSchema from '@/services/users/User/schema/LoginValidationSchema';
|
import LoginValidationSchema from '@/services/users/auth/schema/LoginValidationSchema';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import sendRegisterUserRequest from '@/requests/User/sendRegisterUserRequest';
|
import sendRegisterUserRequest from '@/requests/User/sendRegisterUserRequest';
|
||||||
import { CreateUserValidationSchemaWithUsernameAndEmailCheck } from '@/services/users/User/schema/CreateUserValidationSchemas';
|
import { CreateUserValidationSchemaWithUsernameAndEmailCheck } from '@/services/users/auth/schema/CreateUserValidationSchemas';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import useFollowStatus from '@/hooks/data-fetching/user-follows/useFollowStatus'
|
|||||||
import useGetUsersFollowedByUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowedByUser';
|
import useGetUsersFollowedByUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowedByUser';
|
||||||
import useGetUsersFollowingUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowingUser';
|
import useGetUsersFollowingUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowingUser';
|
||||||
import sendUserFollowRequest from '@/requests/UserFollow/sendUserFollowRequest';
|
import sendUserFollowRequest from '@/requests/UserFollow/sendUserFollowRequest';
|
||||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
import GetUserSchema from '@/services/users/auth/schema/GetUserSchema';
|
||||||
import { FC, useState } from 'react';
|
import { FC, useState } from 'react';
|
||||||
import { FaUserCheck, FaUserPlus } from 'react-icons/fa';
|
import { FaUserCheck, FaUserPlus } from 'react-icons/fa';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import useTimeDistance from '@/hooks/utilities/useTimeDistance';
|
|||||||
import { FC, useContext } from 'react';
|
import { FC, useContext } from 'react';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
import GetUserSchema from '@/services/users/auth/schema/GetUserSchema';
|
||||||
import useGetUsersFollowedByUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowedByUser';
|
import useGetUsersFollowedByUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowedByUser';
|
||||||
import useGetUsersFollowingUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowingUser';
|
import useGetUsersFollowingUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowingUser';
|
||||||
import UserContext from '@/contexts/UserContext';
|
import UserContext from '@/contexts/UserContext';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import findUserByUsername from '@/services/users/User/findUserByUsername';
|
import findUserByUsername from '@/services/users/auth/findUserByUsername';
|
||||||
import Local from 'passport-local';
|
import Local from 'passport-local';
|
||||||
import ServerError from '../util/ServerError';
|
import ServerError from '../util/ServerError';
|
||||||
import { validatePassword } from './passwordFns';
|
import { validatePassword } from './passwordFns';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
import GetUserSchema from '@/services/users/auth/schema/GetUserSchema';
|
||||||
import { IncomingMessage } from 'http';
|
import { IncomingMessage } from 'http';
|
||||||
import { NextApiRequest } from 'next';
|
import { NextApiRequest } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { NextHandler } from 'next-connect';
|
import { NextHandler } from 'next-connect';
|
||||||
import findUserById from '@/services/users/User/findUserById';
|
import findUserById from '@/services/users/auth/findUserById';
|
||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import { getLoginSession } from '../../auth/session';
|
import { getLoginSession } from '../../auth/session';
|
||||||
import { UserExtendedNextApiRequest } from '../../auth/types';
|
import { UserExtendedNextApiRequest } from '../../auth/types';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import useUser from '@/hooks/auth/useUser';
|
import useUser from '@/hooks/auth/useUser';
|
||||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
import GetUserSchema from '@/services/users/auth/schema/GetUserSchema';
|
||||||
import { ReactNode, createContext } from 'react';
|
import { ReactNode, createContext } from 'react';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import editBeerCommentById from '@/services/comments/BeerComment/editBeerCommentById';
|
import editBeerCommentById from '@/services/comments/beer-comment/editBeerCommentById';
|
||||||
import findBeerCommentById from '@/services/comments/BeerComment/findBeerCommentById';
|
import findBeerCommentById from '@/services/comments/beer-comment/findBeerCommentById';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { NextHandler } from 'next-connect';
|
import { NextHandler } from 'next-connect';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import createNewBeerComment from '@/services/comments/BeerComment/createNewBeerComment';
|
import createNewBeerComment from '@/services/comments/beer-comment/createNewBeerComment';
|
||||||
import getAllBeerComments from '@/services/comments/BeerComment/getAllBeerComments';
|
import getAllBeerComments from '@/services/comments/beer-comment/getAllBeerComments';
|
||||||
import {
|
import {
|
||||||
CommentRequest,
|
CommentRequest,
|
||||||
EditAndCreateCommentRequest,
|
EditAndCreateCommentRequest,
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import updateBeerStyleCommentById from '@/services/comments/BeerStyleComment/updateBeerStyleCommentById';
|
import updateBeerStyleCommentById from '@/services/comments/beer-style-comment/updateBeerStyleCommentById';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { NextHandler } from 'next-connect';
|
import { NextHandler } from 'next-connect';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import CommentQueryResult from '@/services/schema/CommentSchema/CommentQueryResult';
|
import CommentQueryResult from '@/services/schema/CommentSchema/CommentQueryResult';
|
||||||
import createNewBeerStyleComment from '@/services/comments/BeerStyleComment/createNewBeerStyleComment';
|
import createNewBeerStyleComment from '@/services/comments/beer-style-comment/createNewBeerStyleComment';
|
||||||
import getAllBeerStyleComments from '@/services/comments/BeerStyleComment/getAllBeerStyleComments';
|
import getAllBeerStyleComments from '@/services/comments/beer-style-comment/getAllBeerStyleComments';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CommentRequest,
|
CommentRequest,
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import getBreweryCommentById from '@/services/comments/BreweryComment/getBreweryCommentById';
|
import getBreweryCommentById from '@/services/comments/brewery-comment/getBreweryCommentById';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { NextHandler } from 'next-connect';
|
import { NextHandler } from 'next-connect';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import CommentQueryResult from '@/services/schema/CommentSchema/CommentQueryResult';
|
import CommentQueryResult from '@/services/schema/CommentSchema/CommentQueryResult';
|
||||||
import createNewBreweryComment from '@/services/comments/BreweryComment/createNewBreweryComment';
|
import createNewBreweryComment from '@/services/comments/brewery-comment/createNewBreweryComment';
|
||||||
import getAllBreweryComments from '@/services/comments/BreweryComment/getAllBreweryComments';
|
import getAllBreweryComments from '@/services/comments/brewery-comment/getAllBreweryComments';
|
||||||
import {
|
import {
|
||||||
CommentRequest,
|
CommentRequest,
|
||||||
EditAndCreateCommentRequest,
|
EditAndCreateCommentRequest,
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import addBeerImageToDB from '@/services/images/BeerImage/addBeerImageToDB';
|
import addBeerImageToDB from '@/services/images/beer-image/addBeerImageToDB';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import addBreweryImageToDB from '@/services/images/BreweryImage/addBreweryImageToDB';
|
import addBreweryImageToDB from '@/services/images/brewery-image/addBreweryImageToDB';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import getBeerPostById from '@/services/posts/BeerPost/getBeerPostById';
|
import getBeerPostById from '@/services/posts/beer-post/getBeerPostById';
|
||||||
import createBeerPostLike from '@/services/likes/BeerPostLike/createBeerPostLike';
|
import createBeerPostLike from '@/services/likes/beer-post-like/createBeerPostLike';
|
||||||
import findBeerPostLikeById from '@/services/likes/BeerPostLike/findBeerPostLikeById';
|
import findBeerPostLikeById from '@/services/likes/beer-post-like/findBeerPostLikeById';
|
||||||
import getBeerPostLikeCountByBeerPostId from '@/services/likes/BeerPostLike/getBeerPostLikeCount';
|
import getBeerPostLikeCountByBeerPostId from '@/services/likes/beer-post-like/getBeerPostLikeCount';
|
||||||
import removeBeerPostLikeById from '@/services/likes/BeerPostLike/removeBeerPostLikeById';
|
import removeBeerPostLikeById from '@/services/likes/beer-post-like/removeBeerPostLikeById';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse, NextApiRequest } from 'next';
|
import { NextApiResponse, NextApiRequest } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import createBeerStyleLike from '@/services/likes/BeerStyleLike/createBeerStyleLike';
|
import createBeerStyleLike from '@/services/likes/beer-style-like/createBeerStyleLike';
|
||||||
import findBeerStyleLikeById from '@/services/likes/BeerStyleLike/findBeerStyleLikeById';
|
import findBeerStyleLikeById from '@/services/likes/beer-style-like/findBeerStyleLikeById';
|
||||||
import getBeerStyleLikeCount from '@/services/likes/BeerStyleLike/getBeerStyleLikeCount';
|
import getBeerStyleLikeCount from '@/services/likes/beer-style-like/getBeerStyleLikeCount';
|
||||||
import removeBeerStyleLikeById from '@/services/likes/BeerStyleLike/removeBeerStyleLikeById';
|
import removeBeerStyleLikeById from '@/services/likes/beer-style-like/removeBeerStyleLikeById';
|
||||||
import getBeerStyleById from '@/services/posts/BeerStyles/getBeerStyleById';
|
import getBeerStyleById from '@/services/posts/beer-style-post/getBeerStyleById';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse, NextApiRequest } from 'next';
|
import { NextApiResponse, NextApiRequest } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import deleteBeerPostById from '@/services/posts/BeerPost/deleteBeerPostById';
|
import deleteBeerPostById from '@/services/posts/beer-post/deleteBeerPostById';
|
||||||
import editBeerPostById from '@/services/posts/BeerPost/editBeerPostById';
|
import editBeerPostById from '@/services/posts/beer-post/editBeerPostById';
|
||||||
import getBeerPostById from '@/services/posts/BeerPost/getBeerPostById';
|
import getBeerPostById from '@/services/posts/beer-post/getBeerPostById';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { NextHandler } from 'next-connect';
|
import { NextHandler } from 'next-connect';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import getBeerRecommendations from '@/services/posts/BeerPost/getBeerRecommendations';
|
import getBeerRecommendations from '@/services/posts/beer-post/getBeerRecommendations';
|
||||||
import getAllBeerPosts from '@/services/posts/BeerPost/getAllBeerPosts';
|
import getAllBeerPosts from '@/services/posts/beer-post/getAllBeerPosts';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import createNewBeerPost from '@/services/posts/BeerPost/createNewBeerPost';
|
import createNewBeerPost from '@/services/posts/beer-post/createNewBeerPost';
|
||||||
import getBeerPostsByPostedById from '@/services/posts/BeerPost/getBeerPostsByPostedById';
|
import getBeerPostsByPostedById from '@/services/posts/beer-post/getBeerPostsByPostedById';
|
||||||
import {
|
import {
|
||||||
BeerPostRequest,
|
BeerPostRequest,
|
||||||
CreateBeerPostRequest,
|
CreateBeerPostRequest,
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
||||||
import CreateBeerPostValidationSchema from '@/services/posts/BeerPost/schema/CreateBeerPostValidationSchema';
|
import CreateBeerPostValidationSchema from '@/services/posts/beer-post/schema/CreateBeerPostValidationSchema';
|
||||||
import EditBeerPostValidationSchema from '@/services/posts/BeerPost/schema/EditBeerPostValidationSchema';
|
import EditBeerPostValidationSchema from '@/services/posts/beer-post/schema/EditBeerPostValidationSchema';
|
||||||
import { NextApiRequest } from 'next';
|
import { NextApiRequest } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
@@ -5,9 +5,9 @@ import DBClient from '@/prisma/DBClient';
|
|||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
|
|
||||||
import getBeerStyleById from '@/services/posts/BeerStyles/getBeerStyleById';
|
import getBeerStyleById from '@/services/posts/beer-style-post/getBeerStyleById';
|
||||||
import getBeerPostsByBeerStyleId from '@/services/posts/BeerPost/getBeerPostsByBeerStyleId';
|
import getBeerPostsByBeerStyleId from '@/services/posts/beer-post/getBeerPostsByBeerStyleId';
|
||||||
import getAllBeerStyles from '@/services/posts/BeerStyles/getAllBeerStyles';
|
import getAllBeerStyles from '@/services/posts/beer-style-post/getAllBeerStyles';
|
||||||
|
|
||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import { CreateBeerStyleRequest, GetBeerStyleByIdRequest } from './types';
|
import { CreateBeerStyleRequest, GetBeerStyleByIdRequest } from './types';
|
||||||
@@ -2,7 +2,7 @@ import { NextApiRequest } from 'next';
|
|||||||
|
|
||||||
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import CreateBeerStyleValidationSchema from '@/services/posts/BeerStyles/schema/CreateBeerStyleValidationSchema';
|
import CreateBeerStyleValidationSchema from '@/services/posts/beer-style-post/schema/CreateBeerStyleValidationSchema';
|
||||||
|
|
||||||
export interface GetBeerStyleByIdRequest extends NextApiRequest {
|
export interface GetBeerStyleByIdRequest extends NextApiRequest {
|
||||||
query: { id: string };
|
query: { id: string };
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import getAllBreweryPostsByPostedById from '@/services/posts/BreweryPost/getAllBreweryPostsByPostedById';
|
import getAllBreweryPostsByPostedById from '@/services/posts/brewery-post/getAllBreweryPostsByPostedById';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import getAllBreweryPosts from '@/services/posts/BreweryPost/getAllBreweryPosts';
|
import getAllBreweryPosts from '@/services/posts/brewery-post/getAllBreweryPosts';
|
||||||
import createNewBreweryPost from '@/services/posts/BreweryPost/createNewBreweryPost';
|
import createNewBreweryPost from '@/services/posts/brewery-post/createNewBreweryPost';
|
||||||
import geocode from '@/config/mapbox/geocoder';
|
import geocode from '@/config/mapbox/geocoder';
|
||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import BreweryPostMapQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostMapQueryResult';
|
import BreweryPostMapQueryResult from '@/services/posts/brewery-post/schema/BreweryPostMapQueryResult';
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import { CreateBreweryPostRequest, GetBreweryPostsRequest } from './types';
|
import { CreateBreweryPostRequest, GetBreweryPostsRequest } from './types';
|
||||||
import { GetAllPostsByConnectedPostId } from '../types';
|
import { GetAllPostsByConnectedPostId } from '../types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
||||||
import CreateBreweryPostSchema from '@/services/posts/BreweryPost/schema/CreateBreweryPostSchema';
|
import CreateBreweryPostSchema from '@/services/posts/brewery-post/schema/CreateBreweryPostSchema';
|
||||||
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
||||||
import { NextApiRequest } from 'next';
|
import { NextApiRequest } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -3,24 +3,24 @@ import localStrat from '@/config/auth/localStrat';
|
|||||||
import { getLoginSession, setLoginSession } from '@/config/auth/session';
|
import { getLoginSession, setLoginSession } from '@/config/auth/session';
|
||||||
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import createNewUser from '@/services/users/User/createNewUser';
|
import createNewUser from '@/services/users/auth/createNewUser';
|
||||||
import findUserByEmail from '@/services/users/User/findUserByEmail';
|
import findUserByEmail from '@/services/users/auth/findUserByEmail';
|
||||||
import { NextApiRequest, NextApiResponse } from 'next';
|
import { NextApiRequest, NextApiResponse } from 'next';
|
||||||
import { expressWrapper } from 'next-connect';
|
import { expressWrapper } from 'next-connect';
|
||||||
import passport from 'passport';
|
import passport from 'passport';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import findUserByUsername from '@/services/users/User/findUserByUsername';
|
import findUserByUsername from '@/services/users/auth/findUserByUsername';
|
||||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
import GetUserSchema from '@/services/users/auth/schema/GetUserSchema';
|
||||||
import sendConfirmationEmail from '@/services/users/User/sendConfirmationEmail';
|
import sendConfirmationEmail from '@/services/users/auth/sendConfirmationEmail';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import type { NextFunction } from 'express';
|
import type { NextFunction } from 'express';
|
||||||
import { verifyConfirmationToken } from '@/config/jwt';
|
import { verifyConfirmationToken } from '@/config/jwt';
|
||||||
import updateUserToBeConfirmedById from '@/services/users/User/updateUserToBeConfirmedById';
|
import updateUserToBeConfirmedById from '@/services/users/auth/updateUserToBeConfirmedById';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import sendResetPasswordEmail from '@/services/users/User/sendResetPasswordEmail';
|
import sendResetPasswordEmail from '@/services/users/auth/sendResetPasswordEmail';
|
||||||
import { hashPassword } from '@/config/auth/passwordFns';
|
import { hashPassword } from '@/config/auth/passwordFns';
|
||||||
import deleteUserById from '@/services/users/User/deleteUserById';
|
import deleteUserById from '@/services/users/auth/deleteUserById';
|
||||||
import {
|
import {
|
||||||
CheckEmailRequest,
|
CheckEmailRequest,
|
||||||
CheckUsernameRequest,
|
CheckUsernameRequest,
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
|||||||
import {
|
import {
|
||||||
CreateUserValidationSchema,
|
CreateUserValidationSchema,
|
||||||
UpdatePasswordSchema,
|
UpdatePasswordSchema,
|
||||||
} from '@/services/users/User/schema/CreateUserValidationSchemas';
|
} from '@/services/users/auth/schema/CreateUserValidationSchemas';
|
||||||
import TokenValidationSchema from '@/services/users/User/schema/TokenValidationSchema';
|
import TokenValidationSchema from '@/services/users/auth/schema/TokenValidationSchema';
|
||||||
import { NextApiRequest } from 'next';
|
import { NextApiRequest } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import findUserById from '@/services/users/User/findUserById';
|
import findUserById from '@/services/users/auth/findUserById';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import getUsersFollowingUser from '@/services/users/UserFollows/getUsersFollowingUser';
|
|
||||||
import getUsersFollowedByUser from '@/services/users/UserFollows/getUsersFollowedByUser';
|
|
||||||
import { NextHandler } from 'next-connect';
|
import { NextHandler } from 'next-connect';
|
||||||
import updateUserAvatarById, {
|
import updateUserAvatarById, {
|
||||||
UpdateUserAvatarByIdParams,
|
UpdateUserAvatarByIdParams,
|
||||||
} from '@/services/users/UserAccount/UpdateUserAvatarByIdParams';
|
} from '@/services/users/account/UpdateUserAvatarByIdParams';
|
||||||
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
||||||
import updateUserProfileById from '@/services/users/User/updateUserProfileById';
|
import updateUserProfileById from '@/services/users/auth/updateUserProfileById';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
UserRouteRequest,
|
UserRouteRequest,
|
||||||
GetUserFollowInfoRequest,
|
GetUserFollowInfoRequest,
|
||||||
@@ -19,6 +18,8 @@ import {
|
|||||||
UpdateAvatarRequest,
|
UpdateAvatarRequest,
|
||||||
UpdateProfileRequest,
|
UpdateProfileRequest,
|
||||||
} from './types';
|
} from './types';
|
||||||
|
import getUsersFollowingUser from '@/services/users/follows/getUsersFollowingUser';
|
||||||
|
import getUsersFollowedByUser from '@/services/users/follows/getUsersFollowedByUser';
|
||||||
|
|
||||||
export const followUser = async (
|
export const followUser = async (
|
||||||
req: UserRouteRequest,
|
req: UserRouteRequest,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
||||||
import EditUserSchema from '@/services/users/User/schema/EditUserSchema';
|
import EditUserSchema from '@/services/users/auth/schema/EditUserSchema';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export interface UserRouteRequest extends UserExtendedNextApiRequest {
|
export interface UserRouteRequest extends UserExtendedNextApiRequest {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
import GetUserSchema from '@/services/users/auth/schema/GetUserSchema';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWR from 'swr';
|
import useSWR from 'swr';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import useSWR from 'swr';
|
import useSWR from 'swr';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult';
|
import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BreweryPostMapQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostMapQueryResult';
|
import BreweryPostMapQueryResult from '@/services/posts/brewery-post/schema/BreweryPostMapQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* - `mutate` A function to mutate the data.
|
* - `mutate` A function to mutate the data.
|
||||||
* - `error` The error object, if any.
|
* - `error` The error object, if any.
|
||||||
*/
|
*/
|
||||||
import FollowInfoSchema from '@/services/users/UserFollows/schema/FollowInfoSchema';
|
import FollowInfoSchema from '@/services/users/follows/schema/FollowInfoSchema';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import FollowInfoSchema from '@/services/users/UserFollows/schema/FollowInfoSchema';
|
import FollowInfoSchema from '@/services/users/follows/schema/FollowInfoSchema';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import useSWRInfinite from 'swr/infinite';
|
import useSWRInfinite from 'swr/infinite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
checkIfBeerCommentOwner,
|
checkIfBeerCommentOwner,
|
||||||
deleteBeerPostComment,
|
deleteBeerPostComment,
|
||||||
editBeerPostComment,
|
editBeerPostComment,
|
||||||
} from '@/controllers/comments/beerComments';
|
} from '@/controllers/comments/beer-comments';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
CommentRequest,
|
CommentRequest,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
checkIfBeerStyleCommentOwner,
|
checkIfBeerStyleCommentOwner,
|
||||||
deleteBeerStyleComment,
|
deleteBeerStyleComment,
|
||||||
editBeerStyleComment,
|
editBeerStyleComment,
|
||||||
} from '@/controllers/comments/beerStyleComments';
|
} from '@/controllers/comments/beer-style-comments';
|
||||||
import { CommentRequest } from '@/controllers/comments/types';
|
import { CommentRequest } from '@/controllers/comments/types';
|
||||||
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import CreateCommentValidationSchema from '@/services/schema/CommentSchema/Creat
|
|||||||
import {
|
import {
|
||||||
createBeerPostComment,
|
createBeerPostComment,
|
||||||
getAllBeerPostComments,
|
getAllBeerPostComments,
|
||||||
} from '@/controllers/comments/beerComments';
|
} from '@/controllers/comments/beer-comments';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
// @TODO: Fix this any type
|
// @TODO: Fix this any type
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
|||||||
import ImageMetadataValidationSchema from '@/services/schema/ImageSchema/ImageMetadataValidationSchema';
|
import ImageMetadataValidationSchema from '@/services/schema/ImageSchema/ImageMetadataValidationSchema';
|
||||||
import { uploadMiddlewareMultiple } from '@/config/multer/uploadMiddleware';
|
import { uploadMiddlewareMultiple } from '@/config/multer/uploadMiddleware';
|
||||||
import { UploadImagesRequest } from '@/controllers/images/types';
|
import { UploadImagesRequest } from '@/controllers/images/types';
|
||||||
import { processBeerImageData } from '@/controllers/images/beerImages';
|
import { processBeerImageData } from '@/controllers/images/beer-images';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
UploadImagesRequest,
|
UploadImagesRequest,
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
|||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
||||||
|
|
||||||
import { EditBeerPostRequest } from '@/controllers/posts/beerPosts/types';
|
import { EditBeerPostRequest } from '@/controllers/posts/beer-posts/types';
|
||||||
import {
|
import {
|
||||||
checkIfBeerPostOwner,
|
checkIfBeerPostOwner,
|
||||||
editBeerPost,
|
editBeerPost,
|
||||||
deleteBeerPost,
|
deleteBeerPost,
|
||||||
} from '@/controllers/posts/beerPosts';
|
} from '@/controllers/posts/beer-posts';
|
||||||
|
|
||||||
import EditBeerPostValidationSchema from '@/services/posts/BeerPost/schema/EditBeerPostValidationSchema';
|
import EditBeerPostValidationSchema from '@/services/posts/beer-post/schema/EditBeerPostValidationSchema';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
|||||||
import {
|
import {
|
||||||
sendBeerPostLikeRequest,
|
sendBeerPostLikeRequest,
|
||||||
getBeerPostLikeCount,
|
getBeerPostLikeCount,
|
||||||
} from '@/controllers/likes/beerPostLikes';
|
} from '@/controllers/likes/beer-posts-likes';
|
||||||
import { LikeRequest } from '@/controllers/likes/types';
|
import { LikeRequest } from '@/controllers/likes/types';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { NextApiResponse } from 'next';
|
|||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import { checkIfBeerPostIsLiked } from '@/controllers/likes/beerPostLikes';
|
import { checkIfBeerPostIsLiked } from '@/controllers/likes/beer-posts-likes';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
UserExtendedNextApiRequest,
|
UserExtendedNextApiRequest,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { getBeerPostRecommendations } from '@/controllers/posts/beerPosts';
|
import { getBeerPostRecommendations } from '@/controllers/posts/beer-posts';
|
||||||
import { GetBeerRecommendationsRequest } from '@/controllers/posts/beerPosts/types';
|
import { GetBeerRecommendationsRequest } from '@/controllers/posts/beer-posts/types';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
|
|
||||||
import CreateBeerPostValidationSchema from '@/services/posts/BeerPost/schema/CreateBeerPostValidationSchema';
|
import CreateBeerPostValidationSchema from '@/services/posts/beer-post/schema/CreateBeerPostValidationSchema';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
||||||
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
||||||
import { createBeerPost } from '@/controllers/posts/beerPosts';
|
import { createBeerPost } from '@/controllers/posts/beer-posts';
|
||||||
import { CreateBeerPostRequest } from '@/controllers/posts/beerPosts/types';
|
import { CreateBeerPostRequest } from '@/controllers/posts/beer-posts/types';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
CreateBeerPostRequest,
|
CreateBeerPostRequest,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { getBeerPosts } from '@/controllers/posts/beerPosts';
|
import { getBeerPosts } from '@/controllers/posts/beer-posts';
|
||||||
import { GetAllBeerPostsRequest } from '@/controllers/posts/beerPosts/types';
|
import { GetAllBeerPostsRequest } from '@/controllers/posts/beer-posts/types';
|
||||||
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { NextApiRequest, NextApiResponse } from 'next';
|
|||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
|
|
||||||
const SearchSchema = z.object({
|
const SearchSchema = z.object({
|
||||||
search: z.string().min(1),
|
search: z.string().min(1),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { getAllBeersByBeerStyle } from '@/controllers/posts/beerStyles';
|
import { getAllBeersByBeerStyle } from '@/controllers/posts/beer-styles';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiRequest, NextApiResponse } from 'next';
|
import { NextApiRequest, NextApiResponse } from 'next';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { z } from 'zod';
|
|||||||
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
||||||
import { createComment, getAll } from '@/controllers/comments/beerStyleComments';
|
import { createComment, getAll } from '@/controllers/comments/beer-style-comments';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
// I don't want to use any, but I can't figure out how to get the types to work
|
// I don't want to use any, but I can't figure out how to get the types to work
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { getBeerStyle } from '@/controllers/posts/beerStyles';
|
import { getBeerStyle } from '@/controllers/posts/beer-styles';
|
||||||
import { GetBeerStyleByIdRequest } from '@/controllers/posts/beerStyles/types';
|
import { GetBeerStyleByIdRequest } from '@/controllers/posts/beer-styles/types';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
|||||||
import {
|
import {
|
||||||
getBeerStyleLikeCountRequest,
|
getBeerStyleLikeCountRequest,
|
||||||
sendBeerStyleLikeRequest,
|
sendBeerStyleLikeRequest,
|
||||||
} from '@/controllers/likes/beerStyleLikes';
|
} from '@/controllers/likes/beer-style-likes';
|
||||||
import { LikeRequest } from '@/controllers/likes/types';
|
import { LikeRequest } from '@/controllers/likes/types';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import APIResponseValidationSchema from '@/validation/APIResponseValidationSchem
|
|||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { checkIfBeerStyleIsLiked } from '@/controllers/likes/beerStyleLikes';
|
import { checkIfBeerStyleIsLiked } from '@/controllers/likes/beer-style-likes';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
UserExtendedNextApiRequest,
|
UserExtendedNextApiRequest,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { createBeerStyle } from '@/controllers/posts/beerStyles';
|
import { createBeerStyle } from '@/controllers/posts/beer-styles';
|
||||||
import { CreateBeerStyleRequest } from '@/controllers/posts/beerStyles/types';
|
import { CreateBeerStyleRequest } from '@/controllers/posts/beer-styles/types';
|
||||||
import CreateBeerStyleValidationSchema from '@/services/posts/BeerStyles/schema/CreateBeerStyleValidationSchema';
|
import CreateBeerStyleValidationSchema from '@/services/posts/beer-style-post/schema/CreateBeerStyleValidationSchema';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { getBeerStyles } from '@/controllers/posts/beerStyles';
|
import { getBeerStyles } from '@/controllers/posts/beer-styles';
|
||||||
import { GetAllPostsRequest } from '@/controllers/posts/types';
|
import { GetAllPostsRequest } from '@/controllers/posts/types';
|
||||||
|
|
||||||
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
|||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
|
|
||||||
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
||||||
import { createComment, getAll } from '@/controllers/comments/breweryComments';
|
import { createComment, getAll } from '@/controllers/comments/brewery-comments';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
// I don't want to use any, but I can't figure out how to get the types to work
|
// I don't want to use any, but I can't figure out how to get the types to work
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
|||||||
import ImageMetadataValidationSchema from '@/services/schema/ImageSchema/ImageMetadataValidationSchema';
|
import ImageMetadataValidationSchema from '@/services/schema/ImageSchema/ImageMetadataValidationSchema';
|
||||||
import { uploadMiddlewareMultiple } from '@/config/multer/uploadMiddleware';
|
import { uploadMiddlewareMultiple } from '@/config/multer/uploadMiddleware';
|
||||||
import { UploadImagesRequest } from '@/controllers/images/types';
|
import { UploadImagesRequest } from '@/controllers/images/types';
|
||||||
import { processBreweryImageData } from '@/controllers/images/breweryImages';
|
import { processBreweryImageData } from '@/controllers/images/brewery-images';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
UploadImagesRequest,
|
UploadImagesRequest,
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { createRouter, NextHandler } from 'next-connect';
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import getBreweryPostById from '@/services/posts/BreweryPost/getBreweryPostById';
|
import getBreweryPostById from '@/services/posts/brewery-post/getBreweryPostById';
|
||||||
import EditBreweryPostValidationSchema from '@/services/posts/BreweryPost/schema/EditBreweryPostValidationSchema';
|
import EditBreweryPostValidationSchema from '@/services/posts/brewery-post/schema/EditBreweryPostValidationSchema';
|
||||||
|
|
||||||
interface BreweryPostRequest extends UserExtendedNextApiRequest {
|
interface BreweryPostRequest extends UserExtendedNextApiRequest {
|
||||||
query: { id: string };
|
query: { id: string };
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
|||||||
import {
|
import {
|
||||||
sendBreweryPostLikeRequest,
|
sendBreweryPostLikeRequest,
|
||||||
getBreweryPostLikeCount,
|
getBreweryPostLikeCount,
|
||||||
} from '@/controllers/likes/breweryPostLikes';
|
} from '@/controllers/likes/brewery-post-likes';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
|||||||
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
||||||
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { getBreweryPostLikeStatus } from '@/controllers/likes/breweryPostLikes';
|
import { getBreweryPostLikeStatus } from '@/controllers/likes/brewery-post-likes';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { NextApiResponse } from 'next';
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
||||||
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
||||||
import CreateBreweryPostSchema from '@/services/posts/BreweryPost/schema/CreateBreweryPostSchema';
|
import CreateBreweryPostSchema from '@/services/posts/brewery-post/schema/CreateBreweryPostSchema';
|
||||||
import createNewBreweryPost from '@/services/posts/BreweryPost/createNewBreweryPost';
|
import createNewBreweryPost from '@/services/posts/brewery-post/createNewBreweryPost';
|
||||||
import geocode from '@/config/mapbox/geocoder';
|
import geocode from '@/config/mapbox/geocoder';
|
||||||
import ServerError from '@/config/util/ServerError';
|
import ServerError from '@/config/util/ServerError';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import BreweryPostMapQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostMapQueryResult';
|
import BreweryPostMapQueryResult from '@/services/posts/brewery-post/schema/BreweryPostMapQueryResult';
|
||||||
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
checkIfBreweryCommentOwner,
|
checkIfBreweryCommentOwner,
|
||||||
deleteBreweryPostComment,
|
deleteBreweryPostComment,
|
||||||
editBreweryPostComment,
|
editBreweryPostComment,
|
||||||
} from '@/controllers/comments/breweryComments';
|
} from '@/controllers/comments/brewery-comments';
|
||||||
import { CommentRequest } from '@/controllers/comments/types';
|
import { CommentRequest } from '@/controllers/comments/types';
|
||||||
|
|
||||||
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema';
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
|||||||
import { editUserInfo, deleteAccount } from '@/controllers/users/auth';
|
import { editUserInfo, deleteAccount } from '@/controllers/users/auth';
|
||||||
import { checkIfUserCanEditUser } from '@/controllers/users/profile';
|
import { checkIfUserCanEditUser } from '@/controllers/users/profile';
|
||||||
import { EditUserRequest } from '@/controllers/users/profile/types';
|
import { EditUserRequest } from '@/controllers/users/profile/types';
|
||||||
import EditUserSchema from '@/services/users/User/schema/EditUserSchema';
|
import EditUserSchema from '@/services/users/auth/schema/EditUserSchema';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
|
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
|||||||
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { GetAllPostsByConnectedPostId } from '@/controllers/posts/types';
|
import { GetAllPostsByConnectedPostId } from '@/controllers/posts/types';
|
||||||
import { getBeerPostsByUserId } from '@/controllers/posts/beerPosts';
|
import { getBeerPostsByUserId } from '@/controllers/posts/beer-posts';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
GetAllPostsByConnectedPostId,
|
GetAllPostsByConnectedPostId,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
|||||||
|
|
||||||
import { TokenValidationRequest } from '@/controllers/users/auth/types';
|
import { TokenValidationRequest } from '@/controllers/users/auth/types';
|
||||||
import { confirmUser } from '@/controllers/users/auth';
|
import { confirmUser } from '@/controllers/users/auth';
|
||||||
import TokenValidationSchema from '@/services/users/User/schema/TokenValidationSchema';
|
import TokenValidationSchema from '@/services/users/auth/schema/TokenValidationSchema';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
TokenValidationRequest,
|
TokenValidationRequest,
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser';
|
|||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { updatePassword } from '@/controllers/users/auth';
|
import { updatePassword } from '@/controllers/users/auth';
|
||||||
import { UpdatePasswordRequest } from '@/controllers/users/auth/types';
|
import { UpdatePasswordRequest } from '@/controllers/users/auth/types';
|
||||||
import { UpdatePasswordSchema } from '@/services/users/User/schema/CreateUserValidationSchemas';
|
import { UpdatePasswordSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas';
|
||||||
|
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
|||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import LoginValidationSchema from '@/services/users/User/schema/LoginValidationSchema';
|
|
||||||
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
import { UserExtendedNextApiRequest } from '@/config/auth/types';
|
||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import { authenticateUser, loginUser } from '@/controllers/users/auth';
|
import { authenticateUser, loginUser } from '@/controllers/users/auth';
|
||||||
|
import LoginValidationSchema from '@/services/users/auth/schema/LoginValidationSchema';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
UserExtendedNextApiRequest,
|
UserExtendedNextApiRequest,
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { createRouter } from 'next-connect';
|
import { createRouter } from 'next-connect';
|
||||||
import { CreateUserValidationSchema } from '@/services/users/User/schema/CreateUserValidationSchemas';
|
|
||||||
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
import NextConnectOptions from '@/config/nextConnect/NextConnectOptions';
|
||||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||||
import { registerUser } from '@/controllers/users/auth';
|
import { registerUser } from '@/controllers/users/auth';
|
||||||
import { RegisterUserRequest } from '@/controllers/users/auth/types';
|
import { RegisterUserRequest } from '@/controllers/users/auth/types';
|
||||||
|
import { CreateUserValidationSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas';
|
||||||
|
|
||||||
const router = createRouter<
|
const router = createRouter<
|
||||||
RegisterUserRequest,
|
RegisterUserRequest,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import Head from 'next/head';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import withPageAuthRequired from '@/util/withPageAuthRequired';
|
import withPageAuthRequired from '@/util/withPageAuthRequired';
|
||||||
import getBeerPostById from '@/services/posts/BeerPost/getBeerPostById';
|
import getBeerPostById from '@/services/posts/beer-post/getBeerPostById';
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
import EditBeerPostForm from '@/components/EditBeerPostForm';
|
import EditBeerPostForm from '@/components/EditBeerPostForm';
|
||||||
import FormPageLayout from '@/components/ui/forms/FormPageLayout';
|
import FormPageLayout from '@/components/ui/forms/FormPageLayout';
|
||||||
import { BiBeer } from 'react-icons/bi';
|
import { BiBeer } from 'react-icons/bi';
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { NextPage, GetServerSideProps } from 'next';
|
import { NextPage, GetServerSideProps } from 'next';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import getBeerPostById from '@/services/posts/BeerPost/getBeerPostById';
|
import getBeerPostById from '@/services/posts/beer-post/getBeerPostById';
|
||||||
|
|
||||||
import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult';
|
import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult';
|
||||||
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import { z } from 'zod';
|
|||||||
|
|
||||||
import useMediaQuery from '@/hooks/utilities/useMediaQuery';
|
import useMediaQuery from '@/hooks/utilities/useMediaQuery';
|
||||||
import { Tab } from '@headlessui/react';
|
import { Tab } from '@headlessui/react';
|
||||||
import getBeerStyleById from '@/services/posts/BeerStyles/getBeerStyleById';
|
import getBeerStyleById from '@/services/posts/beer-style-post/getBeerStyleById';
|
||||||
import BeerStyleHeader from '@/components/BeerStyleById/BeerStyleHeader';
|
import BeerStyleHeader from '@/components/BeerStyleById/BeerStyleHeader';
|
||||||
import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult';
|
import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult';
|
||||||
import BeerStyleCommentSection from '@/components/BeerStyleById/BeerStyleCommentSection';
|
import BeerStyleCommentSection from '@/components/BeerStyleById/BeerStyleCommentSection';
|
||||||
import BeerStyleBeerSection from '@/components/BeerStyleById/BeerStyleBeerSection';
|
import BeerStyleBeerSection from '@/components/BeerStyleById/BeerStyleBeerSection';
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import FormPageLayout from '@/components/ui/forms/FormPageLayout';
|
|||||||
|
|
||||||
import withPageAuthRequired from '@/util/withPageAuthRequired';
|
import withPageAuthRequired from '@/util/withPageAuthRequired';
|
||||||
import DBClient from '@/prisma/DBClient';
|
import DBClient from '@/prisma/DBClient';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import { BeerStyle } from '@prisma/client';
|
import { BeerStyle } from '@prisma/client';
|
||||||
import { NextPage } from 'next';
|
import { NextPage } from 'next';
|
||||||
import { BiBeer } from 'react-icons/bi';
|
import { BiBeer } from 'react-icons/bi';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import getBreweryPostById from '@/services/posts/BreweryPost/getBreweryPostById';
|
import getBreweryPostById from '@/services/posts/brewery-post/getBreweryPostById';
|
||||||
|
|
||||||
interface CreateBeerPageProps {
|
interface CreateBeerPageProps {
|
||||||
brewery: z.infer<typeof BreweryPostQueryResult>;
|
brewery: z.infer<typeof BreweryPostQueryResult>;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import FormPageLayout from '@/components/ui/forms/FormPageLayout';
|
|||||||
import FormSegment from '@/components/ui/forms/FormSegment';
|
import FormSegment from '@/components/ui/forms/FormSegment';
|
||||||
import FormTextArea from '@/components/ui/forms/FormTextArea';
|
import FormTextArea from '@/components/ui/forms/FormTextArea';
|
||||||
import FormTextInput from '@/components/ui/forms/FormTextInput';
|
import FormTextInput from '@/components/ui/forms/FormTextInput';
|
||||||
import getBreweryPostById from '@/services/posts/BreweryPost/getBreweryPostById';
|
import getBreweryPostById from '@/services/posts/brewery-post/getBreweryPostById';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import EditBreweryPostValidationSchema from '@/services/posts/BreweryPost/schema/EditBreweryPostValidationSchema';
|
import EditBreweryPostValidationSchema from '@/services/posts/brewery-post/schema/EditBreweryPostValidationSchema';
|
||||||
import withPageAuthRequired from '@/util/withPageAuthRequired';
|
import withPageAuthRequired from '@/util/withPageAuthRequired';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { NextPage } from 'next';
|
import { NextPage } from 'next';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import getBreweryPostById from '@/services/posts/BreweryPost/getBreweryPostById';
|
import getBreweryPostById from '@/services/posts/brewery-post/getBreweryPostById';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import { GetServerSideProps, NextPage } from 'next';
|
import { GetServerSideProps, NextPage } from 'next';
|
||||||
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import LoadingCard from '@/components/ui/LoadingCard';
|
|||||||
import Spinner from '@/components/ui/Spinner';
|
import Spinner from '@/components/ui/Spinner';
|
||||||
import UserContext from '@/contexts/UserContext';
|
import UserContext from '@/contexts/UserContext';
|
||||||
import useBreweryPosts from '@/hooks/data-fetching/brewery-posts/useBreweryPosts';
|
import useBreweryPosts from '@/hooks/data-fetching/brewery-posts/useBreweryPosts';
|
||||||
import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult';
|
import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult';
|
||||||
import { NextPage } from 'next';
|
import { NextPage } from 'next';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import { useContext, MutableRefObject, useRef } from 'react';
|
import { useContext, MutableRefObject, useRef } from 'react';
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user