fix(doctors): improve filter performance and resolve modal closing issues
This commit is contained in:
@@ -7,10 +7,10 @@ import IconMultipleSelect from "@/components/icons/IconMultipleSelect";
|
||||
function groupSpecialtiesByParent(specialties) {
|
||||
const groups = [];
|
||||
|
||||
const parents = specialties.filter((item) => item.parent === null);
|
||||
const parents = specialties.filter((item) => item.parent_id === null || item.parent_id === undefined);
|
||||
|
||||
parents.forEach((parent) => {
|
||||
const children = specialties.filter((item) => item.parent === parent.id);
|
||||
const children = specialties.filter((item) => String(item.parent_id) === String(parent.id));
|
||||
if (children.length > 0) {
|
||||
groups.push({
|
||||
parent,
|
||||
|
||||
Reference in New Issue
Block a user