fix(tagging): change key from name to id for tagToSelectOption (#25856)
This commit is contained in:
parent
fb35bac070
commit
30cd422331
|
|
@ -0,0 +1,19 @@
|
|||
import { tagToSelectOption } from 'src/components/Tags/utils';
|
||||
|
||||
describe('tagToSelectOption', () => {
|
||||
test('converts a Tag object with table_name to a SelectTagsValue', () => {
|
||||
const tag = {
|
||||
id: '1',
|
||||
name: 'TagName',
|
||||
table_name: 'Table1',
|
||||
};
|
||||
|
||||
const expectedSelectTagsValue = {
|
||||
value: 'TagName',
|
||||
label: 'TagName',
|
||||
key: '1',
|
||||
};
|
||||
|
||||
expect(tagToSelectOption(tag)).toEqual(expectedSelectTagsValue);
|
||||
});
|
||||
});
|
||||
|
|
@ -46,7 +46,7 @@ export const tagToSelectOption = (
|
|||
): SelectTagsValue => ({
|
||||
value: item.name,
|
||||
label: item.name,
|
||||
key: item.name,
|
||||
key: item.id,
|
||||
});
|
||||
|
||||
export const loadTags = async (
|
||||
|
|
|
|||
Loading…
Reference in New Issue