Skip to content

Commit

Permalink
Fix missing edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed Oct 21, 2024
1 parent da4e076 commit edecfa0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/lib/utils/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down Expand Up @@ -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;
};

Expand Down

0 comments on commit edecfa0

Please sign in to comment.