feat(sep): modify item tree specialist
This commit is contained in:
No files matched your search
@@ -47,9 +47,9 @@ export async function getValueLabelList(params: any = null): Promise<{ value: st
|
||||
* @param specialists Array of specialist objects from API
|
||||
* @returns TreeItem[]
|
||||
*/
|
||||
export function getValueTreeItems(specialists: any[]): TreeItem[] {
|
||||
export function getValueTreeItems(specialists: any[], byCode = true): TreeItem[] {
|
||||
return specialists.map((specialist: Specialist) => ({
|
||||
value: specialist.id ? String(specialist.id) : specialist.code,
|
||||
value: byCode ? String(specialist.code) : String(specialist.id),
|
||||
label: specialist.name,
|
||||
hasChildren: Array.isArray(specialist.subspecialists) && specialist.subspecialists.length > 0,
|
||||
children:
|
||||
|
||||
Reference in New Issue
Block a user