fixed fetching of available years
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
# ToDo
|
||||
* infinite scroll
|
||||
* https://stackoverflow.com/questions/67624601/how-to-implement-infinite-scroll-in-next-js
|
||||
* year pagination
|
||||
* build & deploy via docker
|
||||
|
||||
|
||||
# Authentication
|
||||
Authentication consists of the following parts:
|
||||
* `next-auth` boilerplate
|
||||
|
||||
@@ -76,7 +76,7 @@ export const fetchAvailableYears = withUser(async (user:AuthenticatedUser) => {
|
||||
const dbClient = await getDbClient();
|
||||
|
||||
// query mnogodb for all `yearMonth` values
|
||||
const yearMonths = await dbClient.collection<BillingLocation>("lokacije").distinct("year", { userId });
|
||||
const yearMonths = await dbClient.collection<BillingLocation>("lokacije").distinct("yearMonth.year", { userId });
|
||||
|
||||
return(yearMonths);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user