Files
music_library/backlog/completed/ml-12 - Use-Notes.change_note-2-instead-of-Note.changeset-2-in-notes-component.md
T
2026-05-04 21:22:27 +01:00

1.4 KiB

id, title, status, assignee, created_date, labels, dependencies, references, priority
id title status assignee created_date labels dependencies references priority
ML-12 Use Notes.change_note/2 instead of Note.changeset/2 in notes component Done
2026-04-20 08:49
https://github.com/cloud8421/music_library/issues/171
low

Description

GitHub: created 2026-04-16 · updated 2026-04-17 · closed 2026-04-17

Summary

lib/music_library_web/components/notes.ex calls Note.changeset/2 directly at three sites, bypassing the context helper MusicLibrary.Notes.change_note/2 (which already exists and is used at line 97 of the same component).

Evidence

  • lib/music_library_web/components/notes.ex:15
  • lib/music_library_web/components/notes.ex:121
  • lib/music_library_web/components/notes.ex:138

All three could call Notes.change_note(note, %{}) instead.

Why It Matters

The "LiveViews / LiveComponents call the context, not schema modules" boundary is load-bearing in this project. The component already honours it at line 97 — these three spots are the outliers.

Fix

Mechanical find-and-replace. Three one-line edits.

Acceptance Criteria

  • Tests still pass
  • No direct Note.changeset references in lib/music_library_web/components/notes.ex
  • #1 Tests still pass
  • #2 No direct Note.changeset references in lib/music_library_web/components/notes.ex