Skip to content

Commit

Permalink
fix caching
Browse files Browse the repository at this point in the history
  • Loading branch information
polypixeldev committed Jan 16, 2025
1 parent e3b8e20 commit 8bd061a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/harbor/tavern/tavern-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ export const getTavernPeople = async () => {
})
.all()

return records.map((r) => ({
const items = records.map((r) => ({
id: r.id,
status: r.get('tavern_rsvp_status'),
coordinates: r.get('tavern_map_coordinates'),
})) as TavernPersonItem[]

cachedPeople = items
lastPeopleFetch = Date.now()

return items
}

export const getTavernEvents = async () => {
Expand All @@ -59,10 +64,14 @@ export const getTavernEvents = async () => {
})
.all()

return records.map((r) => ({
const items = records.map((r) => ({
id: r.id,
city: r.get('city'),
geocode: r.get('map_geocode'),
organizers: r.get('organizers') ?? [],
})) as TavernEventItem[]

cachedEvents = items
lastEventsFetch = Date.now()
return items
}

0 comments on commit 8bd061a

Please sign in to comment.