Skip to content

Commit 07cb796

Browse files
committed
Fix node tranformation
1 parent 29feaee commit 07cb796

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/shared/hooks/useFetchNodes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import { Post } from 'shared/utils/request';
33

44
type Node = {
55
nd: string;
6+
mg: string;
67
nm: string;
78
[key: string]: any;
89
};
910

10-
const transformNodes = (nodes: Node[] = []) => nodes.map(({ nd, nm, ...rest }) => ({ id: nd, name: nm, ...rest }));
11+
const transformNodes = (nodes: Node[] = []) =>
12+
nodes.map(({ nd, mg, nm, ...rest }) => ({ id: nd || mg, name: nm, ...rest }));
1113

1214
export const getNodes = async (spaceId: string, roomId: string, baseUrl: string) => {
1315
const response = await Post({

0 commit comments

Comments
 (0)