mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 18:52:06 +00:00
refactor image services
This commit is contained in:
@@ -4,12 +4,12 @@ import ServerError from '@/config/util/ServerError';
|
||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||
import { NextApiResponse, NextApiRequest } from 'next';
|
||||
import { z } from 'zod';
|
||||
import { LikeRequest } from '../types';
|
||||
import createBeerPostLike from '@/services/likes/beer-post-like/createBeerPostLike';
|
||||
import findBeerPostLikeById from '@/services/likes/beer-post-like/findBeerPostLikeById';
|
||||
import getBeerPostLikeCountByBeerPostId from '@/services/likes/beer-post-like/getBeerPostLikeCount';
|
||||
import removeBeerPostLikeById from '@/services/likes/beer-post-like/removeBeerPostLikeById';
|
||||
import { getBeerPostById } from '@/services/posts/beer-post';
|
||||
import { LikeRequest } from '../types';
|
||||
|
||||
export const sendBeerPostLikeRequest = async (
|
||||
req: LikeRequest,
|
||||
@@ -20,7 +20,7 @@ export const sendBeerPostLikeRequest = async (
|
||||
|
||||
const beer = await getBeerPostById({ beerPostId: id });
|
||||
if (!beer) {
|
||||
throw new ServerError('Could not find a beer post with that id', 404);
|
||||
throw new ServerError('Could not find a beer post with that id.', 404);
|
||||
}
|
||||
|
||||
const alreadyLiked = await findBeerPostLikeById({
|
||||
|
||||
Reference in New Issue
Block a user