mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 12:13:10 -05:00
20 lines
428 B
TypeScript
20 lines
428 B
TypeScript
import { PrismaClient } from "@prisma/client";
|
|
import { Unwrap } from "lib/types";
|
|
|
|
export type GetBuildsByWeaponData = Unwrap<
|
|
ReturnType<typeof getBuildsByWeapon>
|
|
>;
|
|
|
|
export const getBuildsByWeapon = async ({
|
|
prisma,
|
|
weapon,
|
|
}: {
|
|
prisma: PrismaClient;
|
|
weapon: string;
|
|
}) => {
|
|
return prisma.build.findMany({
|
|
where: { weapon },
|
|
orderBy: [{ top500: "desc" }, { jpn: "desc" }, { updatedAt: "desc" }],
|
|
});
|
|
};
|