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