feat: add category update command#18
Closed
jcorrego wants to merge 2 commits intostephendolan:mainfrom
Closed
Conversation
- Add updateCategory method to API client - Add 'categories update' command with options for name, note, category group, and goal target - Update README with new command documentation - Support updating category name, note, moving to different group, and modifying goal target - Amounts are specified in dollars and converted to milliunits automatically
There was a problem hiding this comment.
Pull request overview
Adds support for updating category details (name, note, group, goal target) via the YNAB API, exposed through a new ynab categories update CLI command.
Changes:
- Added
updateCategoryto theYnabClientAPI wrapper. - Added
categories updatecommand with flags for name/note/group/goal target updates and input validation. - Documented the new command in the README.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/lib/api-client.ts | Adds an API client wrapper method for PATCHing category updates via YNAB. |
| src/commands/categories.ts | Introduces the categories update CLI command and constructs the PATCH payload from provided flags. |
| README.md | Adds the categories update command to the command list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix validation to use !== undefined checks instead of falsy checks - Reject empty/whitespace category names instead of converting to null - Update README to show optional flags with brackets
Author
|
@stephendolan Comments have been addressed. Please take a look. |
Owner
|
Added some fixes/changes in #19 Had some issues actually working on your branch, so least friction was to open a new one. It's live for you to use in the latest version! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to update category details using the YNAB API.
Changes
updateCategorymethod to API clientcategories updatecommand with options for:--name: Update category name--note: Update category note--category-group-id: Move category to different group--goal-target: Update goal target amount (in dollars)Usage Examples
All code passes TypeScript type checking and linting.