mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-04-06 02:19:05 +00:00
Refactor: begin reorganizing services dir.
- Renamed files and directories to reflect the new structure - Moved comment-related services to the 'comments' directory - Moved image-related services to the 'images' directory - Moved like-related services to the 'likes' directory - Moved post-related services to the 'posts' directory - Moved user-related services to the 'users' directory
This commit is contained in:
18
src/services/likes/BeerStyleLike/createBeerStyleLike.ts
Normal file
18
src/services/likes/BeerStyleLike/createBeerStyleLike.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { z } from 'zod';
|
||||
import DBClient from '@/prisma/DBClient';
|
||||
import GetUserSchema from '@/services/users/User/schema/GetUserSchema';
|
||||
|
||||
interface CreateBeerStyleLikeArgs {
|
||||
beerStyleId: string;
|
||||
user: z.infer<typeof GetUserSchema>;
|
||||
}
|
||||
const createBeerStyleLike = async ({ beerStyleId, user }: CreateBeerStyleLikeArgs) => {
|
||||
return DBClient.instance.beerStyleLike.create({
|
||||
data: {
|
||||
beerStyleId,
|
||||
likedById: user.id,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export default createBeerStyleLike;
|
||||
Reference in New Issue
Block a user