Refactor year management in the database layer, enhance Year model with budget field, and update UI components for year selection and dashboard display
This commit is contained in:
@@ -11,11 +11,16 @@ const db = new PrismaClient({ adapter });
|
||||
const GET = {
|
||||
year: async (where: Prisma.YearWhereUniqueInput) => {
|
||||
return await db.year.findUnique({
|
||||
where
|
||||
where,
|
||||
include: {
|
||||
people: true
|
||||
}
|
||||
});
|
||||
},
|
||||
years: async () => {
|
||||
return await db.year.findMany();
|
||||
years: async (where: Prisma.YearWhereInput) => {
|
||||
return await db.year.findMany({
|
||||
where
|
||||
});
|
||||
},
|
||||
|
||||
person: async (where: Prisma.PersonWhereUniqueInput) => {
|
||||
@@ -23,9 +28,12 @@ const GET = {
|
||||
where
|
||||
});
|
||||
},
|
||||
people: async (where: Prisma.PersonWhereUniqueInput) => {
|
||||
people: async (where: Prisma.PersonWhereInput) => {
|
||||
return await db.person.findMany({
|
||||
where
|
||||
where,
|
||||
include: {
|
||||
gifts: true
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user