fix(doctors): improve filter performance and resolve modal closing issues

This commit is contained in:
hamed
2026-06-21 15:47:37 +03:30
parent 2fc74a664e
commit cb13ba3f45
10 changed files with 232 additions and 58 deletions
+2 -2
View File
@@ -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,