@@ -10,6 +10,15 @@ import {
10
10
UpdateUserOrgRolePayload ,
11
11
} from "redux/reduxActions/orgActions" ;
12
12
import { ApiResponse , GenericApiResponse } from "./apiResponses" ;
13
+ import {
14
+ ApiPaginationResponse ,
15
+ fetchGroupUserRequestType ,
16
+ fetchOrgsByEmailRequestType ,
17
+ fetchOrgUserRequestType ,
18
+ GenericApiPaginationResponse ,
19
+ GroupUsersPaginationResponse ,
20
+ orgGroupRequestType , OrgUsersPaginationResponse
21
+ } from "@lowcoder-ee/util/pagination/type" ;
13
22
14
23
export interface GroupUsersResponse extends ApiResponse {
15
24
data : {
@@ -66,6 +75,10 @@ export class OrgApi extends Api {
66
75
return Api . get ( OrgApi . fetchGroupURL ) ;
67
76
}
68
77
78
+ static fetchGroupPagination ( request : orgGroupRequestType ) : AxiosPromise < GenericApiPaginationResponse < OrgGroup [ ] > > {
79
+ return Api . get ( OrgApi . fetchGroupURL , { ...request } ) ;
80
+ }
81
+
69
82
static deleteGroup ( groupId : string ) : AxiosPromise < ApiResponse > {
70
83
return Api . delete ( OrgApi . deleteGroupURL ( groupId ) ) ;
71
84
}
@@ -88,10 +101,20 @@ export class OrgApi extends Api {
88
101
return Api . get ( OrgApi . fetchOrgUsersURL ( orgId ) ) ;
89
102
}
90
103
104
+ static fetchOrgUsersPagination ( request :fetchOrgUserRequestType ) : AxiosPromise < OrgUsersPaginationResponse > {
105
+ const { orgId, ...res } = request ;
106
+ return Api . get ( OrgApi . fetchOrgUsersURL ( orgId ) , { ...res } ) ;
107
+ }
108
+
91
109
static fetchGroupUsers ( groupId : string ) : AxiosPromise < GroupUsersResponse > {
92
110
return Api . get ( OrgApi . fetchGroupUsersURL ( groupId ) ) ;
93
111
}
94
112
113
+ static fetchGroupUsersPagination ( request : fetchGroupUserRequestType ) : AxiosPromise < GroupUsersPaginationResponse > {
114
+ const { groupId, ...res } = request ;
115
+ return Api . get ( OrgApi . fetchGroupUsersURL ( groupId ) , { ...res } ) ;
116
+ }
117
+
95
118
static deleteGroupUser ( request : RemoveGroupUserPayload ) : AxiosPromise < ApiResponse > {
96
119
return Api . delete ( OrgApi . deleteGroupUserURL ( request . groupId ) , {
97
120
userId : request . userId ,
@@ -145,6 +168,11 @@ export class OrgApi extends Api {
145
168
static fetchOrgsByEmail ( email : string ) : AxiosPromise < ApiResponse > {
146
169
return Api . get ( OrgApi . fetchOrgsByEmailURL ( email ) ) ;
147
170
}
171
+
172
+ static fetchOrgsPaginationByEmail ( request : fetchOrgsByEmailRequestType ) : AxiosPromise < ApiPaginationResponse > {
173
+ const { email, ...rest } = request ;
174
+ return Api . get ( OrgApi . fetchOrgsByEmailURL ( email ) , { ...rest } ) ;
175
+ }
148
176
}
149
177
150
178
export default OrgApi ;
0 commit comments