@@ -18,7 +18,7 @@ type TagListItem = {
18
18
const DEFAULT_QUERY_LIMIT = 25 ;
19
19
20
20
export const useTagsList = ( options : TagsListOptions ) => {
21
- const { viewAll, department, filter, limit } = options ;
21
+ const { viewAll, department, filter, limit = DEFAULT_QUERY_LIMIT } = options ;
22
22
23
23
const getTags = useEndpoint ( 'GET' , '/v1/livechat/tags' ) ;
24
24
@@ -34,7 +34,7 @@ export const useTagsList = (options: TagsListOptions) => {
34
34
const { tags, ...data } = await getTags ( {
35
35
text : filter ,
36
36
offset,
37
- count : limit ?? DEFAULT_QUERY_LIMIT ,
37
+ count : limit ,
38
38
...( viewAll && { viewAll : 'true' } ) ,
39
39
...( department && { department } ) ,
40
40
sort : JSON . stringify ( { name : 1 } ) ,
@@ -52,7 +52,7 @@ export const useTagsList = (options: TagsListOptions) => {
52
52
return offset < lastPage . total ? offset : undefined ;
53
53
} ,
54
54
initialData : ( ) => ( {
55
- pages : [ { tags : [ ] , total : 0 , offset : 0 , count : limit ?? DEFAULT_QUERY_LIMIT } ] ,
55
+ pages : [ { tags : [ ] , offset : 0 , count : 0 , total : Infinity } ] ,
56
56
pageParams : [ 0 ] ,
57
57
} ) ,
58
58
} ) ;
0 commit comments