HandleEnrollment

Function: handleEnrollment()

[object Object]

Defined in: app/components/Activity/ActivityDetailsTile/ActivityDetailsTile.handlers.tsx:56

Handles the enrollment of a user into an activity. Validates authentication status, submits answers to the API, and updates the local state.

Parameters

authService

IAuthService

The authentication service instance to retrieve user information.

activity

ActivityResponseDto

The current activity object.

setActivity

Dispatch<SetStateAction<ActivityResponseDto | null>> | undefined

State setter to update the activity with the new enrollment list.

answers

Record<number, string>

A record of question IDs and user-provided answers.

setSubmitting

(submitting) => void

Callback to toggle the loading state of the UI.

Returns

Promise<void>

A promise that resolves when the enrollment process completes.

On this page