Skip to content

Add edit command to the notes CLI - #155

Open
MishaLehotskyi wants to merge 7 commits into
mate-academy:mainfrom
MishaLehotskyi:review-me
Open

Add edit command to the notes CLI#155
MishaLehotskyi wants to merge 7 commits into
mate-academy:mainfrom
MishaLehotskyi:review-me

Conversation

@MishaLehotskyi

Copy link
Copy Markdown

Adds an edit <id> <text> command so an existing note's text can be changed in place.

  • lib/store.js: new edit(id, text) — loads the store, finds the note by id, replaces its text, saves.
  • notes.js: new edit case wired to store.edit, and the help line now lists it.

Merged main into the branch to resolve the add/add conflict in lib/store.js. npm test passes.

@MishaLehotskyi

Copy link
Copy Markdown
Author

Claude caught the planted bug: store.edit() writes to the result of .find() without checking it exists, so editing a non-existent id crashes with TypeError: Cannot set properties of undefined — and CI stayed green because no test covers edit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants