From 75669e7cc746e46c5fb91998ecca3ac8838d8204 Mon Sep 17 00:00:00 2001 From: Abdul Rahman Reza Date: Sun, 1 Dec 2024 13:41:58 +0700 Subject: [PATCH] update children --- src/controllers/auth.ts | 68 ++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/controllers/auth.ts b/src/controllers/auth.ts index 2b37b2a..f5f6020 100644 --- a/src/controllers/auth.ts +++ b/src/controllers/auth.ts @@ -148,46 +148,46 @@ export class AuthController { list_child[p.id_parent].push(p); } - // for (let f of list_data_final) { - // delete f.status - // delete f.created_at - // delete f.updated_at - // delete f.deleted_at + for (let f of list_data_final) { + delete f.status + delete f.created_at + delete f.updated_at + delete f.deleted_at - // if (list_child[f.id]) { - // f.children = list_child[f.id]; + if (list_child[f.id]) { + f.children = list_child[f.id]; - // for (let g of f.children) { - // if (list_child[g.id]) { - // g.children = list_child[g.id]; + for (let g of f.children) { + if (list_child[g.id]) { + g.children = list_child[g.id]; - // for (let h of g.children) { - // if (list_child[h.id]) { - // h.children = list_child[h.id]; + for (let h of g.children) { + if (list_child[h.id]) { + h.children = list_child[h.id]; - // for (let i of h.children) { - // if (list_child[i.id]) { - // i.children = list_child[i.id]; + for (let i of h.children) { + if (list_child[i.id]) { + i.children = list_child[i.id]; - // for (let j of i.children) { - // if (list_child[j.id]) { - // j.children = list_child[j.id]; + for (let j of i.children) { + if (list_child[j.id]) { + j.children = list_child[j.id]; - // for (let k of j.children) { - // if (list_child[k.id]) { - // k.children = list_child[k.id]; - // } - // } - // } - // } - // } - // } - // } - // } - // } - // } - // } - // } + for (let k of j.children) { + if (list_child[k.id]) { + k.children = list_child[k.id]; + } + } + } + } + } + } + } + } + } + } + } + } return list_data_final;