Skip to content

Commit 775ab8b

Browse files
committed
Fix parsing user id to preferences
1 parent 4df310d commit 775ab8b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

client/src/components/User/UserPreferencesForm.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { BAlert } from "bootstrap-vue";
33
import { storeToRefs } from "pinia";
44
import { computed, ref, watchEffect } from "vue";
5-
import { useRouter } from "vue-router/composables";
65
76
import { isRegisteredUser } from "@/api";
87
import {
@@ -18,6 +17,7 @@ import LoadingSpan from "@/components/LoadingSpan.vue";
1817
1918
interface Props {
2019
formId: UserPreferencesKey;
20+
id?: string;
2121
}
2222
2323
const props = defineProps<Props>();
@@ -29,13 +29,11 @@ const breadcrumbItems = computed(() => [{ title: "User Preferences", to: "/user"
2929
const userStore = useUserStore();
3030
const { currentUser } = storeToRefs(userStore);
3131
32-
const router = useRouter();
33-
3432
const loading = ref(true);
3533
3634
const model = computed<UserPreferencesModel | undefined>(() => {
37-
if (router.currentRoute.params.id) {
38-
return getUserPreferencesModel(router.currentRoute.params.id);
35+
if (props.id) {
36+
return getUserPreferencesModel(props.id);
3937
} else if (isRegisteredUser(currentUser.value)) {
4038
return getUserPreferencesModel(currentUser.value.id);
4139
} else {

client/src/entry/analysis/router.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,10 @@ export function getRouter(Galaxy) {
642642
{
643643
path: "user/:formId",
644644
component: UserPreferencesForm,
645-
props: true,
645+
props: (route) => ({
646+
formId: route.params.formId,
647+
id: route.query.id,
648+
}),
646649
redirect: redirectAnon(),
647650
},
648651
{

0 commit comments

Comments
 (0)