MCPcopy Create free account
hub / github.com/simstudioai/sim / fetchInvitation

Function fetchInvitation

apps/sim/app/invite/[id]/invite.tsx:204–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 if (!session?.user) return
203
204 async function fetchInvitation() {
205 setIsLoading(true)
206 try {
207 const data = await requestJson(getInvitationContract, {
208 params: { id: inviteId },
209 query: { token: token ?? undefined },
210 })
211 setInvitation(data.invitation)
212 setError(null)
213 } catch (fetchError) {
214 logger.error('Error fetching invitation:', fetchError)
215 const code =
216 fetchError instanceof ApiClientError
217 ? codeFromApiClientError(fetchError)
218 : 'network-error'
219 setError(getInviteError(code))
220 } finally {
221 setIsLoading(false)
222 }
223 }
224
225 fetchInvitation()
226 }, [session?.user, inviteId, token])

Callers 1

InviteFunction · 0.70

Calls 5

requestJsonFunction · 0.90
setErrorFunction · 0.85
codeFromApiClientErrorFunction · 0.85
getInviteErrorFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected