mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 20:30:54 -05:00
22 lines
528 B
TypeScript
22 lines
528 B
TypeScript
import type { Prisma } from "@prisma/client";
|
|
import { db } from "~/utils/db.server";
|
|
|
|
export type FindTrusters = Prisma.PromiseReturnType<typeof findTrusters>;
|
|
export function findTrusters(userId: string) {
|
|
return db.trustRelationships.findMany({
|
|
where: { trustReceiverId: userId },
|
|
select: {
|
|
trustGiver: {
|
|
select: {
|
|
id: true,
|
|
discordName: true,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
export function findById(userId: string) {
|
|
return db.user.findUnique({ where: { id: userId } });
|
|
}
|