@@ -8,6 +8,7 @@ import type {
88 GetInvitationsParams ,
99 GetMembershipRequestParams ,
1010 GetMemberships ,
11+ GetMembershipsParams ,
1112 GetPendingInvitationsParams ,
1213 GetRolesParams ,
1314 InviteMemberParams ,
@@ -26,7 +27,6 @@ import type {
2627 UpdateMembershipParams ,
2728 UpdateOrganizationParams ,
2829} from '@clerk/types' ;
29- import type { GetMembershipsParams } from '@clerk/types' ;
3030
3131import { unixEpochToDate } from '../../utils/date' ;
3232import { convertPageToOffset } from '../../utils/pagesToOffset' ;
@@ -109,11 +109,16 @@ export class Organization extends BaseResource implements OrganizationResource {
109109 } ;
110110
111111 getRoles = async ( getRolesParams ?: GetRolesParams ) => {
112- return await BaseResource . _fetch ( {
113- path : `/organizations/${ this . id } /roles` ,
114- method : 'GET' ,
115- search : convertPageToOffset ( getRolesParams ) as any ,
116- } ) . then ( res => {
112+ return await BaseResource . _fetch (
113+ {
114+ path : `/organizations/${ this . id } /roles` ,
115+ method : 'GET' ,
116+ search : convertPageToOffset ( getRolesParams ) as any ,
117+ } ,
118+ {
119+ forceUpdateClient : true ,
120+ } ,
121+ ) . then ( res => {
117122 const { data : roles , total_count } = res ?. response as unknown as ClerkPaginatedResponse < RoleJSON > ;
118123
119124 return {
@@ -126,11 +131,16 @@ export class Organization extends BaseResource implements OrganizationResource {
126131 getDomains = async (
127132 getDomainParams ?: GetDomainsParams ,
128133 ) : Promise < ClerkPaginatedResponse < OrganizationDomainResource > > => {
129- return await BaseResource . _fetch ( {
130- path : `/organizations/${ this . id } /domains` ,
131- method : 'GET' ,
132- search : convertPageToOffset ( getDomainParams ) as any ,
133- } )
134+ return await BaseResource . _fetch (
135+ {
136+ path : `/organizations/${ this . id } /domains` ,
137+ method : 'GET' ,
138+ search : convertPageToOffset ( getDomainParams ) as any ,
139+ } ,
140+ {
141+ forceUpdateClient : true ,
142+ } ,
143+ )
134144 . then ( res => {
135145 const { data : invites , total_count } =
136146 res ?. response as unknown as ClerkPaginatedResponse < OrganizationDomainJSON > ;
@@ -197,13 +207,18 @@ export class Organization extends BaseResource implements OrganizationResource {
197207 deprecated ( 'offset' , 'Use `initialPage` instead in Organization.limit.' , 'organization:getMemberships:offset' ) ;
198208 }
199209
200- return await BaseResource . _fetch ( {
201- path : `/organizations/${ this . id } /memberships` ,
202- method : 'GET' ,
203- search : isDeprecatedParams
204- ? getMembershipsParams
205- : ( convertPageToOffset ( getMembershipsParams as unknown as any ) as any ) ,
206- } )
210+ return await BaseResource . _fetch (
211+ {
212+ path : `/organizations/${ this . id } /memberships` ,
213+ method : 'GET' ,
214+ search : isDeprecatedParams
215+ ? getMembershipsParams
216+ : ( convertPageToOffset ( getMembershipsParams as unknown as any ) as any ) ,
217+ } ,
218+ {
219+ forceUpdateClient : true ,
220+ } ,
221+ )
207222 . then ( res => {
208223 if ( isDeprecatedParams ) {
209224 const organizationMembershipsJSON = res ?. response as unknown as OrganizationMembershipJSON [ ] ;
@@ -248,11 +263,16 @@ export class Organization extends BaseResource implements OrganizationResource {
248263 getInvitations = async (
249264 getInvitationsParams ?: GetInvitationsParams ,
250265 ) : Promise < ClerkPaginatedResponse < OrganizationInvitationResource > > => {
251- return await BaseResource . _fetch ( {
252- path : `/organizations/${ this . id } /invitations` ,
253- method : 'GET' ,
254- search : convertPageToOffset ( getInvitationsParams ) as any ,
255- } )
266+ return await BaseResource . _fetch (
267+ {
268+ path : `/organizations/${ this . id } /invitations` ,
269+ method : 'GET' ,
270+ search : convertPageToOffset ( getInvitationsParams ) as any ,
271+ } ,
272+ {
273+ forceUpdateClient : true ,
274+ } ,
275+ )
256276 . then ( res => {
257277 const { data : requests , total_count } =
258278 res ?. response as unknown as ClerkPaginatedResponse < OrganizationInvitationJSON > ;
0 commit comments