ENGLISH·COURSE API
    Preparing search index...

    Variable

    learnerActionClientConst

    learnerActionClient: SafeActionClient<
        string,
        undefined,
        undefined,
        undefined,
        true,
        { learnerId: string },
        undefined,
        undefined,
        undefined,
        readonly [],
        {} | undefined,
        false,
        false,
        { learnerId: string },
    > = ...

    The safe-action client for anything that reads or writes one learner's data.

    Its middleware verifies the session from the request's own headers and hands the action ctx.learnerId. That is the only way an action learns who the learner is: no input schema built on this client may carry a user or learner id, so a client cannot act for someone else. Without a session the action body never runs and the caller receives serverError.

    export const markLessonCompleteAction = learnerActionClient
    .inputSchema(z.object({ lessonId: LessonId }))
    .action(async ({ parsedInput, ctx }) => markFor(ctx.learnerId, parsedInput.lessonId));