mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-01 15:37:32 +08:00
Fix parsing user id to preferences
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import { BAlert } from "bootstrap-vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { computed, ref, watchEffect } from "vue";
|
||||
import { useRouter } from "vue-router/composables";
|
||||
|
||||
import { isRegisteredUser } from "@/api";
|
||||
import {
|
||||
@@ -18,6 +17,7 @@ import LoadingSpan from "@/components/LoadingSpan.vue";
|
||||
|
||||
interface Props {
|
||||
formId: UserPreferencesKey;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
@@ -29,13 +29,11 @@ const breadcrumbItems = computed(() => [{ title: "User Preferences", to: "/user"
|
||||
const userStore = useUserStore();
|
||||
const { currentUser } = storeToRefs(userStore);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
const model = computed<UserPreferencesModel | undefined>(() => {
|
||||
if (router.currentRoute.params.id) {
|
||||
return getUserPreferencesModel(router.currentRoute.params.id);
|
||||
if (props.id) {
|
||||
return getUserPreferencesModel(props.id);
|
||||
} else if (isRegisteredUser(currentUser.value)) {
|
||||
return getUserPreferencesModel(currentUser.value.id);
|
||||
} else {
|
||||
|
||||
@@ -642,7 +642,10 @@ export function getRouter(Galaxy) {
|
||||
{
|
||||
path: "user/:formId",
|
||||
component: UserPreferencesForm,
|
||||
props: true,
|
||||
props: (route) => ({
|
||||
formId: route.params.formId,
|
||||
id: route.query.id,
|
||||
}),
|
||||
redirect: redirectAnon(),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user