fixed fetching of available years

This commit is contained in:
2024-01-09 16:28:12 +01:00
parent 8cbf254f38
commit 53a266df44
2 changed files with 2 additions and 4 deletions

View File

@@ -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);
})