Bumped dependencies & added error display for Posts

This commit is contained in:
Flycro
2022-02-05 22:59:52 +01:00
parent 9db5b5781e
commit 94140719b8
4 changed files with 1092 additions and 1041 deletions

View File

@@ -15,6 +15,7 @@ export const usePostStore = defineStore('post', () => {
async function fetchPosts() {
postList.value = []
errors.value = []
loading.value = true
const result = await fetch('https://api.flycro.me/items/Post')
if (!result.ok) errors.value.push({ message: 'Failed to fetch posts' })
@@ -73,6 +74,7 @@ export const usePostStore = defineStore('post', () => {
initialLoad,
postList,
currentPost,
errors,
}
})