From aad335849849662f5858068fc4a7aae25f992358 Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Tue, 9 Jul 2019 11:21:37 +0200 Subject: [PATCH] user: load run on component creation --- src/views/User.vue | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/views/User.vue b/src/views/User.vue index 47f41b7..f3f1824 100644 --- a/src/views/User.vue +++ b/src/views/User.vue @@ -16,7 +16,7 @@
{{username}} - +
@@ -26,7 +26,7 @@ :class="[{ 'tab-element-selected': $route.name === 'user projects' || $route.name === 'user' }]" > - + Projects @@ -35,12 +35,12 @@ :class="[{ 'tab-element-selected': $route.name === 'user direct runs' }]" > - + Direct Runs
  • - +
  • - +
  • - + Root Project Group Settings
  • @@ -87,7 +87,7 @@ :class="[{ 'tab-element-selected': $route.name.endsWith('user settings') }]" > - + User Settings @@ -103,7 +103,7 @@
    @@ -117,7 +117,7 @@ class="block px-4 py-2 hover:bg-blue-500 hover:text-white" :to="projectGroupSettingsLink('user', username, [])" > - + Root Project Group Settings @@ -199,6 +199,16 @@ export default { projectGroupCreateProjectGroupLink("user", this.username, []) ); } + }, + created: async function() { + if (this.$route.params.runid) { + let { data, error } = await fetchRun(this.$route.params.runid); + if (error) { + this.$store.dispatch("setError", error); + return; + } + this.run = data; + } } };