frontend: delay fullpage init after post fetch

Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
Nicolas Froger 2024-07-25 12:51:23 +02:00
commit 90163b5db5
No known key found for this signature in database
2 changed files with 16 additions and 5 deletions

View file

@ -11,7 +11,7 @@ export const usePostsStore = defineStore('posts', () => {
const posts = ref([])
function fetchPosts() {
fetch(postsApiPath)
return fetch(postsApiPath)
.then((response) => {
return response.json()
})
@ -28,7 +28,5 @@ export const usePostsStore = defineStore('posts', () => {
})
}
fetchPosts()
return { posts }
return { posts, fetchPosts }
})