diff --git a/frontend/src/lib/utils/crud.ts b/frontend/src/lib/utils/crud.ts index a5252157e..423211a52 100644 --- a/frontend/src/lib/utils/crud.ts +++ b/frontend/src/lib/utils/crud.ts @@ -5,7 +5,7 @@ import LanguageDisplay from '$lib/components/ModelTable/LanguageDisplay.svelte'; import LibraryActions from '$lib/components/ModelTable/LibraryActions.svelte'; import UserGroupNameDisplay from '$lib/components/ModelTable/UserGroupNameDisplay.svelte'; import { BASE_API_URL } from './constants'; -import type { urlModel } from './types'; +import { URL_MODEL, type urlModel } from './types'; type GetOptionsParams = { objects: any[]; @@ -711,9 +711,10 @@ export const urlParamModelSelectFields = (model: string): SelectField[] => { }; export const getModelInfo = (model: urlModel | string): ModelMapEntry => { - const map = URL_MODEL_MAP[model] || {}; + const baseModel = model.split('_')[0]; + const map = URL_MODEL_MAP[model] || URL_MODEL_MAP[baseModel] || {}; // The urlmodel of {model}_duplicate must be {model} - map['urlModel'] = model.split('_')[0]; + map['urlModel'] = baseModel; return map; };