Skip to content

Commit

Permalink
refactor: update variable names from 'total' to 'new' in GET function…
Browse files Browse the repository at this point in the history
… for consistency
  • Loading branch information
ad956 committed Sep 4, 2024
1 parent 1d67a91 commit 9d29551
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/api/admin/dashboard/tiles/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export async function GET(request: Request) {
const db = mongoose.connection.db;

const [
totalHospitals,
totalPatients,
totalDoctors,
totalReceptionists,
newHospitals,
newPatients,
newDoctors,
newReceptionists,
bookedAppointments,
] = await Promise.all([
db.collection("hospital").countDocuments(),
Expand All @@ -32,11 +32,11 @@ export async function GET(request: Request) {
]);

const result = {
totalHospitals,
totalPatients,
totalDoctors,
totalReceptionists,
totalBookedAppointments: bookedAppointments[0]?.total || 0,
newHospitals,
newPatients,
newDoctors,
newReceptionists,
newBookedAppointments: bookedAppointments[0]?.total || 0,
};

return Response.json(result);
Expand Down

0 comments on commit 9d29551

Please sign in to comment.