Skip to content

Commit

Permalink
Flip spaces cache logic
Browse files Browse the repository at this point in the history
  • Loading branch information
shu8 committed May 14, 2023
1 parent 16b55b8 commit d61415c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uclapi/libcal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const getSpaces = async (
) => {

// Can't use cache if we need the (group) spaces specific availability
if (date) return await fetchSpaces(ctx, categories, token)
if (date) return await fetchSpaces(ctx, categories, token, date)

// If we don't need specific availabiliy, we can use cache
const spaces = []
Expand All @@ -100,7 +100,7 @@ const getSpaces = async (

if (categoryIdsToFetch.length > 0) {
// Finally, fetch (and cache) spaces for the remaining uncached category IDs
spaces.push(...(await fetchSpaces(ctx, categoryIdsToFetch, token, date)))
spaces.push(...(await fetchSpaces(ctx, categoryIdsToFetch, token)))
}

return spaces
Expand Down

0 comments on commit d61415c

Please sign in to comment.