MCPcopy Index your code
hub / github.com/simstudioai/sim / unblockOrgMembers

Function unblockOrgMembers

apps/sim/lib/billing/organizations/membership.ts:123–140  ·  view source on GitHub ↗
(
  organizationId: string,
  reason: BillingBlockReason
)

Source from the content-addressed store, hash-verified

121 * Returns the number of members actually unblocked
122 */
123export async function unblockOrgMembers(
124 organizationId: string,
125 reason: BillingBlockReason
126): Promise<number> {
127 const memberIds = await getOrgMemberIds(organizationId)
128
129 if (memberIds.length === 0) {
130 return 0
131 }
132
133 const result = await db
134 .update(userStats)
135 .set({ billingBlocked: false, billingBlockedReason: null })
136 .where(and(inArray(userStats.userId, memberIds), eq(userStats.billingBlockedReason, reason)))
137 .returning({ userId: userStats.userId })
138
139 return result.length
140}
141
142export interface RestoreProResult {
143 restored: boolean

Callers 2

handleDisputeClosedFunction · 0.90

Calls 3

getOrgMemberIdsFunction · 0.85
setMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected