PJob-prisma/server/api/test.ts

28 lines
477 B
TypeScript
Raw Normal View History

2024-04-12 10:23:44 +00:00
import { PrismaClient } from "@prisma/client";
const db = new PrismaClient();
async function a() {
return await db.job.findMany({
where: {
data: {
pay: {
gte: 10,
},
},
},
orderBy: [
{
pin: "desc",
},
{
updateTime: "desc",
},
],
include: {
data: true,
},
});
}
export default defineEventHandler(async (event) => {
return await a();
});