Skip to content

Commit

Permalink
Fix Groups Empty (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaldivia committed Apr 7, 2020
1 parent 12a682e commit 9566f6e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions portal-ui/src/screens/Console/Groups/Groups.tsx
Expand Up @@ -137,8 +137,16 @@ const Groups = ({ classes }: IGroupsProps) => {
api
.invoke("GET", `/api/v1/groups?offset=${offset}&limit=${rowsPerPage}`)
.then((res: GroupsList) => {
setRecords(res.groups.sort(groupsSort));
setTotalRecords(res.total);
let resGroups: string[] = [];
if (res.groups !== null) {
resGroups = res.groups.sort(groupsSort);
}
setRecords(resGroups);
let total = 0;
if (res.total !== null) {
total = res.total;
}
setTotalRecords(total);
setError("");
isLoading(false);

Expand Down

0 comments on commit 9566f6e

Please sign in to comment.