diff --git a/src/components/ResourceBar.astro b/src/components/ResourceBar.astro index 64421b9..6da3895 100644 --- a/src/components/ResourceBar.astro +++ b/src/components/ResourceBar.astro @@ -1,15 +1,14 @@ --- import { ObjectId } from 'mongodb'; -import { getUserResources } from '../lib/utils/resourceManager'; +import { calculateCurrentAvailableResources, getUserResources } from '../lib/utils/resourceManager'; import { getHighestWeightedLanguage, getLocales } from '../lib/lang/langDriver'; import resourceTypes from '../lib/data/resources.json'; -import format from '../lib/utils/format'; const resourceLang = await getLocales(getHighestWeightedLanguage(Astro.request.headers.get('accept-language')), 'resources'); const resBarLang = await getLocales(getHighestWeightedLanguage(Astro.request.headers.get('accept-language')), 'resourcebar'); -const resources = await getUserResources(new ObjectId(Astro.cookies.get('userid')?.value ?? '')); +const resources = await calculateCurrentAvailableResources(new ObjectId(Astro.cookies.get('userid')?.value ?? '')); const resourceArray = []; for(const key in resources) { @@ -33,7 +32,7 @@ for(const key in resources) {