{responseCode: "00", responseMsg: "ok",…} msgInfo: {msgId: 1256, category: "G", title: "test", titleYn: "Y", type: "S", sendUserSeq: 10651,…} attachmentYn: "N" category: "G" content: [{resSeq: 1816, resType: "T", resUrl: "", resContent: "test", resSize: 4, resResolution: null,…}] fileAllow: "GUC100" msgId: 1256 msgType: "U" receiveName: "" regDate: "2020-09-18 11:11:13" reservationTime: null sendUserName: "테스트4" sendUserSeq: 10651 sendYn: "Y" smsYn: "N" title: "test" titleYn: "Y" type: "S" recvList: [{userSeq: 4892, userName: "노희석", cancelYn: "N", readDate: null, readYn: "N"},…] 0: {userSeq: 4892, userName: "노희석", cancelYn: "N", readDate: null, readYn: "N"} 1: {userSeq: 4951, userName: "박남신", cancelYn: "N", readDate: null, readYn: "N"} 2: {userSeq: 6377, userName: "양호중", cancelYn: "N", readDate: null, readYn: "N"} 3: {userSeq: 6891, userName: "정지용", cancelYn: "N", readDate: null, readYn: "N"} 4: {userSeq: 8966, userName: "강혜숙", cancelYn: "N", readDate: null, readYn: "N"} 5: {userSeq: 9283, userName: "조정훈", cancelYn: "N", readDate: null, readYn: "N"} 6: {userSeq: 10363, userName: "IC센터", cancelYn: "N", readDate: null, readYn: "N"} 7: {userSeq: 10648, userName: "테스트1", cancelYn: "N", readDate: null, readYn: "N"} 8: {userSeq: 10649, userName: "테스트2", cancelYn: "N", readDate: null, readYn: "N"} 9: {userSeq: 10650, userName: "테스트3", cancelYn: "N", readDate: null, readYn: "N"} for (const item of groupList) { const nodeType = item.division; const node: GroupNode = { nodeType, children: [] }; item.groupList.sort((a, b) => a.registDate < b.registDate ? 1 : a.registDate > b.registDate ? -1 : 0 ); item.groupList.forEach((groupInfo) => { node.children.push({ nodeType, groupInfo }); }); if (!!this.nodeMap.get(item.division)) { this.nodeMap.get(item.division)[0].children = node.children; } else { this.nodeMap.set(item.division, [node]); } } // deleted filtering. this.nodeMap = new Map( [...this.nodeMap.entries()].filter( (map) => list.findIndex((item) => item.division === map[0]) > -1 ) ); // sorting. this.nodeMap = new Map( [...this.nodeMap.entries()].sort((a, b) => b[0] > a[0] ? 1 : b[0] < a[0] ? -1 : 0 ) ); { "statusCode": 200, "errorMessage": "", "data": { "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/call/history?callDvCd=in&page=0&size=10&sort=createdDt,desc" } ], "content": [ { "callingNum": "01071116902", "rcvNum": "07082774004", "callDvCd": "in", "callTypCd": "DOD", "callStTime": "2020-09-24T18:50:36+0900", "callEdTime": "2020-09-24T18:52:08+0900", "totalCallTime": "85", "callStsCd": "00", "callKindCd": 0, "contactInfo": { "name": "홍길동_1", "position": "차장", "bookmark": 0, "blacklist": 0, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/contact/6" } ] }, "id": 39, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/call/history/39" } ] }, { "callingNum": "01071116902", "rcvNum": "07082774004", "callDvCd": "in", "callTypCd": "DOD", "callStTime": "2020-09-24T18:37:40+0900", "callEdTime": "2020-09-24T18:46:50+0900", "totalCallTime": "0", "callStsCd": "02", "callKindCd": 0, "contactInfo": { "name": "홍길동_1", "position": "차장", "bookmark": 0, "blacklist": 0, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/contact/6" } ] }, "id": 38, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/call/history/38" } ] }, { "callingNum": "01071116902", "rcvNum": "07082774004", "callDvCd": "in", "callTypCd": "DOD", "callStTime": "2020-09-24T18:33:21+0900", "callEdTime": "2020-09-24T18:34:32+0900", "totalCallTime": "47", "callStsCd": "00", "callKindCd": 0, "contactInfo": { "name": "홍길동_1", "position": "차장", "bookmark": 0, "blacklist": 0, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/contact/6" } ] }, "id": 36, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/call/history/36" } ] }, { "callingNum": "01071116902", "rcvNum": "07082774004", "callDvCd": "in", "callTypCd": "DOD", "callStTime": "2020-09-24T18:21:28+0900", "callEdTime": "2020-09-24T18:22:25+0900", "totalCallTime": "36", "callStsCd": "00", "callKindCd": 0, "contactInfo": { "name": "홍길동_1", "position": "차장", "bookmark": 0, "blacklist": 0, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/contact/6" } ] }, "id": 35, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/call/history/35" } ] }, { "callingNum": "01071116902", "rcvNum": "07082774004", "callDvCd": "in", "callTypCd": "DOD", "callStTime": "2020-09-24T18:18:23+0900", "callEdTime": "2020-09-24T18:19:04+0900", "totalCallTime": "0", "callStsCd": "02", "callKindCd": 0, "contactInfo": { "name": "홍길동_1", "position": "차장", "bookmark": 0, "blacklist": 0, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/contact/6" } ] }, "id": 34, "links": [ { "rel": "self", "href": "http://127.0.0.1:9095/api/v1.0/call/history/34" } ] } ], "page": { "size": 10, "totalElements": 5, "totalPages": 1, "number": 0 } } }