Skip to content

Commit

Permalink
fix: #1481 Fix application env parameter undefined error (#1489)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCatherine1994 authored Jul 16, 2024
1 parent cf0d5b6 commit cb15fbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/grantaccess/form/UserNameInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { UserType, AppEnv } from 'fam-app-acsctl-api';
import type { IdimProxyBceidInfo, IdimProxyIdirInfo } from 'fam-app-acsctl-api';
import FamLoginUserState from '@/store/FamLoginUserState';
import {
selectedApplicationEnv,
selectedApplication,
selectedApplicationId,
} from '@/store/ApplicationState';
import { FAM_APPLICATION_ID } from '@/store/Constants';
Expand Down Expand Up @@ -43,7 +43,7 @@ const verifiedUserIdentity = ref<IdimProxyIdirInfo | IdimProxyBceidInfo | null>(
);
const verifyUserId = async () => {
try {
let appEnv = selectedApplicationEnv;
let appEnv = selectedApplication.value?.env as AppEnv;
if (!appEnv && selectedApplicationId.value == FAM_APPLICATION_ID)
appEnv = AppEnv.Prod;
Expand Down
14 changes: 2 additions & 12 deletions frontend/src/store/ApplicationState.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FamApplicationDto, AppEnv } from 'fam-admin-mgmt-api/model';
import type { FamApplicationDto } from 'fam-admin-mgmt-api/model';
import { computed, ref } from 'vue';

export const CURRENT_SELECTED_APPLICATION_KEY = 'CURRENT_SELECTED_APPLICATION';
Expand Down Expand Up @@ -30,20 +30,10 @@ export const selectedApplicationId = computed(() => {

// --- Getter

export const selectedApplicationShortDisplayText = computed(() => {
if (selectedApplication.value) {
return `${selectedApplication.value.name.toUpperCase()}`;
} else {
return '';
}
});

export const selectedApplicationDisplayText = computed(() => {
if (selectedApplication.value) {
return `${selectedApplication.value.description}`;
} else {
return '';
}
});

export const selectedApplicationEnv = selectedApplication.value?.env as AppEnv;
});

0 comments on commit cb15fbe

Please sign in to comment.