mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
16 lines
460 B
TypeScript
16 lines
460 B
TypeScript
import DBClient from '@/prisma/DBClient';
|
|
import { z } from 'zod';
|
|
import GetUserSchema from '../User/schema/GetUserSchema';
|
|
|
|
interface CreateBeerPostLikeArgs {
|
|
id: string;
|
|
user: z.infer<typeof GetUserSchema>;
|
|
}
|
|
|
|
const createBeerPostLike = async ({ id, user }: CreateBeerPostLikeArgs) =>
|
|
DBClient.instance.beerPostLike.create({
|
|
data: { beerPost: { connect: { id } }, likedBy: { connect: { id: user.id } } },
|
|
});
|
|
|
|
export default createBeerPostLike;
|