mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Refactor: move service logic out of api routes and into separate files
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
import DBClient from '@/prisma/DBClient';
|
||||
|
||||
const findBeerPostLikeById = async (beerPostId: string, likedById: string) =>
|
||||
interface FindBeerPostLikeByIdArgs {
|
||||
beerPostId: string;
|
||||
likedById: string;
|
||||
}
|
||||
|
||||
const findBeerPostLikeById = async ({
|
||||
beerPostId,
|
||||
likedById,
|
||||
}: FindBeerPostLikeByIdArgs) =>
|
||||
DBClient.instance.beerPostLike.findFirst({ where: { beerPostId, likedById } });
|
||||
|
||||
export default findBeerPostLikeById;
|
||||
|
||||
Reference in New Issue
Block a user