Skip to content

IA-956: feat: Add subject unassignment and improve subject/assignment loading reliability

khadija.elbachouri a demandé de fusionner feature/IA-956 vers develop

Summary

Adds the ability to unassign subjects from a child, and improves the robustness of subject fetching and assignment state management.

Changes

ChildSubjectsManager

  • Added unassign logic in saveChanges: now computes toAssign and toUnassign diffs against currently assigned subjects, and calls unassignSubjectFromChild in parallel for removed subjects
  • Fixed toggleSubject to use local currentSelected count from modalSubjects instead of stale selectedCount from outer scope
  • Added ListEmptyComponent in the modal FlatList to handle loading and empty states gracefully
  • Fixed early-return guard to check child.uuid instead of child.id
  • Combined assignedSubjectsLoading and subjectsLoading into a single loading guard block
  • Modal subtitle now simplified to per-child quota wording

subscriptionStore

  • Added unassignSubjectFromChild(childUuid, subjectUuid) action calling DELETE .../child/:childUuid/subject/:subjectUuid
  • fetchAssignedSubjectsByChild now resets assignedSubjects: [] before fetching to avoid stale data flash

subjectStore

  • Added guard for empty levelUuid to skip fetch early
  • Resets subjects: [] before each fetch
  • Adds pagination params { size: 1000, page: 0 } to the request
  • Handles both array and paginated ({ content: [] }) response shapes
  • Normalizes subjectUuid by falling back to s.uuid if missing

subscriptionEndpoints

  • Added unassignSubject(childUuid, subjectUuid) endpoint:
    DELETE .../assign-subjects/child/:childUuid/subject/:subjectUuid

Rapports de requête de fusion