Skip to content

Commit 9e17a58

Browse files
committed
Handle empty labels array
1 parent ee7b523 commit 9e17a58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/shared/utils/transformations.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export const getFilters = (labels: any[]) => {
2525
};
2626
};
2727

28-
export const getGroupingByList = (labels: any) => {
28+
export const getGroupingByList = (labels: any[]) => {
29+
if (!labels?.length) {
30+
return GroupByList;
31+
}
32+
2933
return [...GroupByList, ...labels.map((label: any) => ({ value: label.id, label: label.id }))];
3034
};

0 commit comments

Comments
 (0)