fixed result sorting
This commit is contained in:
@@ -98,7 +98,11 @@ export const fetchAllLocations = withUser(async (user:AuthenticatedUser, pageIx:
|
|||||||
// fetch `pageSize` locations for the given page index
|
// fetch `pageSize` locations for the given page index
|
||||||
const locations = await dbClient.collection<BillingLocation>("lokacije")
|
const locations = await dbClient.collection<BillingLocation>("lokacije")
|
||||||
.find({ userId })
|
.find({ userId })
|
||||||
.sort({ yearMonth: -1, name: 1 })
|
.sort({
|
||||||
|
"yearMonth.year": -1,
|
||||||
|
"yearMonth.month": -1,
|
||||||
|
name: 1,
|
||||||
|
})
|
||||||
.skip(pageIx * pageSize)
|
.skip(pageIx * pageSize)
|
||||||
.limit(pageSize)
|
.limit(pageSize)
|
||||||
.toArray();
|
.toArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user