9ff4c0dbd5
* Setup project-wide prettier * Remove old workspace file * Remove old debugging directives * New top-level .prettierignore * Updated Prettier config settings * Contrubuting guide: Fix for some bad code blocks * Added more ignores * Improved the format script command * printWidth set to 100 * Formatted entire repo (pnpm run format)
23 lines
513 B
TypeScript
23 lines
513 B
TypeScript
import { PrismaClient, prisma } from "~/db.server";
|
|
|
|
export class ApiVoteService {
|
|
#prismaClient: PrismaClient;
|
|
|
|
constructor(prismaClient: PrismaClient = prisma) {
|
|
this.#prismaClient = prismaClient;
|
|
}
|
|
|
|
public async call({ userId, identifier }: { userId: string; identifier: string }) {
|
|
return this.#prismaClient.apiIntegrationVote.create({
|
|
data: {
|
|
user: {
|
|
connect: {
|
|
id: userId,
|
|
},
|
|
},
|
|
apiIdentifier: identifier,
|
|
},
|
|
});
|
|
}
|
|
}
|