mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Refactor codebase, format
This commit is contained in:
20
services/BeerPostLike/createBeerPostLike.ts
Normal file
20
services/BeerPostLike/createBeerPostLike.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user