Bumped dependencies & added error display for Posts

merge-requests/9/head
Flycro 2022-02-05 22:59:52 +01:00
parent 9db5b5781e
commit 94140719b8
4 changed files with 1092 additions and 1041 deletions

View File

@ -12,56 +12,58 @@
"typecheck": "vue-tsc --noEmit"
},
"dependencies": {
"@vueuse/core": "^7.4.1",
"@vueuse/head": "^0.7.4",
"@vueuse/core": "^7.5.5",
"@vueuse/head": "^0.7.5",
"@vueuse/motion": "^2.0.0-beta.9",
"dayjs": "^1.10.7",
"nprogress": "^0.2.0",
"pinia": "^2.0.9",
"pinia": "^2.0.11",
"prism-theme-vars": "^0.2.2",
"vue": "^3.2.26",
"vue": "^3.2.29",
"vue-demi": "^0.12.1",
"vue-i18n": "^9.1.9",
"vue-router": "^4.0.12"
},
"devDependencies": {
"@antfu/eslint-config": "^0.14.0",
"@antfu/eslint-config": "^0.14.2",
"@iconify-json/akar-icons": "^1.0.8",
"@iconify-json/bi": "^1.0.10",
"@iconify-json/carbon": "^1.0.12",
"@iconify-json/clarity": "^1.0.1",
"@iconify-json/bi": "^1.0.12",
"@iconify-json/carbon": "^1.0.14",
"@iconify-json/clarity": "^1.0.2",
"@iconify-json/ei": "^1.0.2",
"@iconify-json/entypo": "^1.0.1",
"@iconify-json/ic": "^1.0.8",
"@iconify-json/ion": "^1.0.3",
"@intlify/vite-plugin-vue-i18n": "^3.2.1",
"@types/markdown-it-link-attributes": "^3.0.1",
"@types/nprogress": "^0.2.0",
"@vitejs/plugin-vue": "^2.0.1",
"@vue/compiler-sfc": "^3.2.26",
"@vue/server-renderer": "^3.2.26",
"@vitejs/plugin-vue": "^2.1.0",
"@vue/compiler-sfc": "^3.2.29",
"@vue/server-renderer": "^3.2.29",
"@vue/test-utils": "^2.0.0-rc.18",
"critters": "^0.0.15",
"cross-env": "^7.0.3",
"cypress": "^9.1.1",
"eslint": "^8.5.0",
"cypress": "^9.4.1",
"eslint": "^8.8.0",
"eslint-plugin-cypress": "^2.12.1",
"https-localhost": "^4.7.0",
"markdown-it-link-attributes": "^4.0.0",
"markdown-it-prism": "^2.2.1",
"markdown-it-prism": "^2.2.2",
"patch-vue-directive-ssr": "^0.0.1",
"pnpm": "^6.24.3",
"typescript": "^4.5.4",
"unplugin-auto-import": "^0.5.4",
"pnpm": "^6.29.1",
"typescript": "^4.5.5",
"unplugin-auto-import": "^0.5.11",
"unplugin-icons": "^0.13.0",
"unplugin-vue-components": "^0.17.11",
"vite": "^2.7.6",
"vite-plugin-inspect": "^0.3.11",
"unplugin-vue-components": "^0.17.16",
"vite": "^2.7.13",
"vite-plugin-inspect": "^0.3.13",
"vite-plugin-md": "^0.11.7",
"vite-plugin-pages": "^0.19.7",
"vite-plugin-pwa": "^0.11.12",
"vite-plugin-pages": "^0.19.9",
"vite-plugin-pwa": "^0.11.13",
"vite-plugin-vue-layouts": "^0.5.0",
"vite-plugin-windicss": "^1.6.1",
"vite-ssg": "^0.17.2",
"vite-plugin-windicss": "^1.6.3",
"vite-ssg": "^0.17.9",
"vitest": "^0.0.113",
"vue-tsc": "^0.30.0"
"vue-tsc": "^0.30.6"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
<div>
<h1>Blog</h1>
<div>
<ei:spinner-3 v-if="post.loading" class="text-4xl text-fly animate-spin" />
<ei:spinner-3 v-if="post.loading" class="text-4xl text-fly-600 dark:text-fly-500 animate-spin" />
<ul
v-if="post.postList && post.loading === false" key="test" v-motion class="list-none"
:initial="{ opacity: 0 }" :enter="{opacity: 1, transition: {delay: 0.5,} }"
@ -33,6 +33,9 @@
>
No Posts found
</div>
<div v-if="post.errors.length > 0" class="flex">
<ic:baseline-error class="text-xl mr-2 text-fly-600 dark:text-fly-500" /> {{ post.errors[0].message }}
</div>
</div>
</div>
</template>

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,
}
})