Skip to content

Peel: convert checkBlockCompletion to a React Query mutation #2012

Description

@brian-smith-tcril

Part of #1946 — Redux → React Query migration (Stage 1). Part of the #1976 courseware decomposition (plan) — Target 2 (outline sidebar), peel. Stacked on the sequence conversion.

Goal: convert checkBlockCompletion to a React Query mutation.

Why its own layer: it's the courseware requestCert — a shared writer that patches both the units model (complete) and the sidebar's courseware.courseOutline completion rollups (updateCourseOutlineCompletion), and it has two consumers in different layers (CoursewareContainer on unit render, and the outline sidebar on unit click). Peeling it below both consumers keeps them from fighting over completion state once the sidebar is also React-Query-backed.

Tasks

  • Convert checkBlockCompletionuseMutation; on success update the units cache (via the bridge) and the outline cache (setQueryData, replacing updateCourseOutlineCompletion).
  • Preserve the "already complete → no-op" short-circuit.

Verify: completing a unit updates the unit indicator and the sidebar completion rollups (incl. the courseOutlineShouldUpdate refetch trigger for locked sequences).

Scoped-but-light; a full plan gets added when this is picked up.

Metadata

Metadata

Labels

No labels
No labels

Projects

Status
Todo

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions