diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-06 14:55:58 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-06 14:55:58 +0200 |
commit | c2dc7906e47a05cecc6350fd6a3d6f6f955a3423 (patch) | |
tree | 0f3895eb00783943a13d27235dfd88bcda5a844c /packages/client/src/views/RepositoryAbout.vue | |
parent | 49e6ae50447130ba6e2efd2b561f1b1dcc033099 (diff) |
Frontend uses shared types
Diffstat (limited to 'packages/client/src/views/RepositoryAbout.vue')
-rw-r--r-- | packages/client/src/views/RepositoryAbout.vue | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/client/src/views/RepositoryAbout.vue b/packages/client/src/views/RepositoryAbout.vue index ff96f53..dc759d1 100644 --- a/packages/client/src/views/RepositoryAbout.vue +++ b/packages/client/src/views/RepositoryAbout.vue @@ -16,11 +16,12 @@ <script lang="ts"> import { defineComponent, Ref, ref } from "vue"; import fetchData from "../util/fetch"; +import { Tree } from "shared_types"; +import { getParam } from "../util/util"; import RepositoryTreeBlob from "../components/RepositoryTreeBlob.vue"; import Loading from "vue-loading-overlay"; import BaseErrorMessage from "../components/BaseErrorMessage.vue"; -import { getParam } from "../util/util"; export default defineComponent({ name: "RepositoryAbout", @@ -35,9 +36,9 @@ export default defineComponent({ const fetch_failed: Ref<string> = ref(""); const fetchReadme = async(repository: string) => { - const readme_data = await fetchData(`repos/${repository}/tree?path=README.md`, fetch_failed, is_loading, "tree"); + const readme_data: Tree = await fetchData(`repos/${repository}/tree?path=README.md`, fetch_failed, is_loading, "tree"); - if(readme_data) { + if(readme_data && typeof readme_data.content === "string") { readme.value = readme_data.content; } }; |