+
@@ -19,8 +25,8 @@
diff --git a/src/views/Logout.vue b/src/views/Logout.vue
index 8a7bde5..921b5b5 100644
--- a/src/views/Logout.vue
+++ b/src/views/Logout.vue
@@ -1,10 +1,10 @@
diff --git a/src/views/Register.vue b/src/views/Register.vue
index 0ca1f84..9d0f091 100644
--- a/src/views/Register.vue
+++ b/src/views/Register.vue
@@ -31,7 +31,9 @@ import { mapGetters } from "vuex";
import LoginForm from "@/components/loginform";
import RegisterForm from "@/components/registerform";
-import { apiurl, authorizeurl, registerurl, fetch, logout } from "@/util/auth";
+import { fetchRemoteSources } from "@/util/data";
+
+import { authorizeurl, registerurl, fetch, doLogout } from "@/util/auth";
export default {
name: "Register",
@@ -48,9 +50,13 @@ export default {
...mapGetters(["registeruser"])
},
methods: {
- async getRemoteSources() {
- let res = await (await fetch(apiurl("/remotesources"))).json();
- this.remotesources = res;
+ async fetchRemoteSources() {
+ let { data, error } = await fetchRemoteSources();
+ if (error) {
+ this.$store.dispatch("setError", error);
+ return;
+ }
+ this.remotesources = data;
},
async doAuthorize(rsName, username, password) {
let u = authorizeurl();
@@ -99,8 +105,8 @@ export default {
}
},
created: function() {
- logout();
- this.getRemoteSources();
+ doLogout();
+ this.fetchRemoteSources();
}
};
diff --git a/src/views/User.vue b/src/views/User.vue
index b1042f6..0feb2d5 100644
--- a/src/views/User.vue
+++ b/src/views/User.vue
@@ -117,7 +117,12 @@ export default {
watch: {
$route: async function(route) {
if (route.params.runid) {
- this.run = await fetchRun(route.params.runid);
+ let { data, error } = await fetchRun(route.params.runid);
+ if (error) {
+ this.$store.dispatch("setError", error);
+ return;
+ }
+ this.run = data;
}
}
},