mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Refactor and formatting
This commit is contained in:
@@ -2,19 +2,14 @@ import DBClient from '@/prisma/DBClient';
|
||||
import { z } from 'zod';
|
||||
import GetUserSchema from '../User/schema/GetUserSchema';
|
||||
|
||||
const createBeerPostLike = async ({
|
||||
id,
|
||||
user,
|
||||
}: {
|
||||
interface CreateBeerPostLikeArgs {
|
||||
id: string;
|
||||
user: z.infer<typeof GetUserSchema>;
|
||||
}) => {
|
||||
return DBClient.instance.beerPostLike.create({
|
||||
data: {
|
||||
beerPost: { connect: { id } },
|
||||
likedBy: { connect: { id: user.id } },
|
||||
},
|
||||
}
|
||||
|
||||
const createBeerPostLike = async ({ id, user }: CreateBeerPostLikeArgs) =>
|
||||
DBClient.instance.beerPostLike.create({
|
||||
data: { beerPost: { connect: { id } }, likedBy: { connect: { id: user.id } } },
|
||||
});
|
||||
};
|
||||
|
||||
export default createBeerPostLike;
|
||||
|
||||
Reference in New Issue
Block a user