mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Rename "user" column in beerPostLikes, add ERD gen
This commit is contained in:
@@ -12,7 +12,7 @@ const createBeerPostLike = async ({
|
||||
return DBClient.instance.beerPostLike.create({
|
||||
data: {
|
||||
beerPost: { connect: { id } },
|
||||
user: { connect: { id: user.id } },
|
||||
likedBy: { connect: { id: user.id } },
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import DBClient from '@/prisma/DBClient';
|
||||
|
||||
const findBeerPostLikeById = async (beerPostId: string, userId: string) =>
|
||||
DBClient.instance.beerPostLike.findFirst({
|
||||
where: {
|
||||
beerPostId,
|
||||
userId,
|
||||
},
|
||||
});
|
||||
const findBeerPostLikeById = async (beerPostId: string, likedById: string) =>
|
||||
DBClient.instance.beerPostLike.findFirst({ where: { beerPostId, likedById } });
|
||||
|
||||
export default findBeerPostLikeById;
|
||||
|
||||
Reference in New Issue
Block a user