Skip to content

Commit 9566f6e

Browse files
authored
Fix Groups Empty (#45)
1 parent 12a682e commit 9566f6e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

portal-ui/src/screens/Console/Groups/Groups.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,16 @@ const Groups = ({ classes }: IGroupsProps) => {
137137
api
138138
.invoke("GET", `/api/v1/groups?offset=${offset}&limit=${rowsPerPage}`)
139139
.then((res: GroupsList) => {
140-
setRecords(res.groups.sort(groupsSort));
141-
setTotalRecords(res.total);
140+
let resGroups: string[] = [];
141+
if (res.groups !== null) {
142+
resGroups = res.groups.sort(groupsSort);
143+
}
144+
setRecords(resGroups);
145+
let total = 0;
146+
if (res.total !== null) {
147+
total = res.total;
148+
}
149+
setTotalRecords(total);
142150
setError("");
143151
isLoading(false);
144152

0 commit comments

Comments
 (0)