Check that each location's latest photo exists
This commit is contained in:
@@ -99,7 +99,9 @@
|
||||
// Add last updated date to each location
|
||||
data.locations.data.forEach(location => {
|
||||
const latestPhoto = latestPhotos.find(photo => photo.location.id === location.id)
|
||||
if (latestPhoto) {
|
||||
location.last_updated = latestPhoto.created_on
|
||||
}
|
||||
})
|
||||
|
||||
// Set data into store
|
||||
@@ -171,7 +173,7 @@
|
||||
{/each}
|
||||
</svelte:head>
|
||||
|
||||
<slot></slot>
|
||||
<slot />
|
||||
|
||||
<Transition />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user