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/RepositoryLog.vue | |
parent | 49e6ae50447130ba6e2efd2b561f1b1dcc033099 (diff) |
Frontend uses shared types
Diffstat (limited to 'packages/client/src/views/RepositoryLog.vue')
-rw-r--r-- | packages/client/src/views/RepositoryLog.vue | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/packages/client/src/views/RepositoryLog.vue b/packages/client/src/views/RepositoryLog.vue index e210dd2..c5ce241 100644 --- a/packages/client/src/views/RepositoryLog.vue +++ b/packages/client/src/views/RepositoryLog.vue @@ -53,23 +53,11 @@ import { defineComponent, Ref, ref } from "vue"; import { format } from "date-fns"; import fetchData from "../util/fetch"; import { getParam } from "../util/util"; +import { LogCommit } from "shared_types"; import Loading from "vue-loading-overlay"; import BaseErrorMessage from "../components/BaseErrorMessage.vue"; -type Commit = { - id: string, - author: { - name: string, - email: string - }, - message: string, - date: number, - insertions: number, - deletions: number, - files_changed: number -} - export default defineComponent({ name: "RepositoryLog", components: { @@ -82,12 +70,12 @@ export default defineComponent({ }; }, setup() { - const commits: Ref<Commit[] | null> = ref(null); + const commits: Ref<LogCommit[] | null> = ref(null); const is_loading: Ref<boolean> = ref(true); const fetch_failed: Ref<string> = ref(""); const fetchLog = async(repository: string) => { - const log_data: Commit[] = await fetchData(`repos/${repository}/log`, fetch_failed, is_loading, "log"); + const log_data: LogCommit[] = await fetchData(`repos/${repository}/log`, fetch_failed, is_loading, "log"); if(log_data) { commits.value = log_data; } |