Implement Category API methods (GetAllCategories, GetCategory)
- GetAllCategories returns all categories for a project - GetCategory returns a single category by ID - Returns ErrCategoryNotFound for non-existent categories - Added ErrCategoryNotFound to IsNotFound helper - Comprehensive test coverage
This commit is contained in:
parent
2d3be3619c
commit
fc4577e729
4 changed files with 207 additions and 2 deletions
|
|
@ -39,6 +39,9 @@ var (
|
|||
|
||||
// ErrCommentNotFound indicates the specified comment was not found.
|
||||
ErrCommentNotFound = errors.New("comment not found")
|
||||
|
||||
// ErrCategoryNotFound indicates the specified category was not found.
|
||||
ErrCategoryNotFound = errors.New("category not found")
|
||||
)
|
||||
|
||||
// Logic errors
|
||||
|
|
@ -82,7 +85,8 @@ func IsNotFound(err error) bool {
|
|||
errors.Is(err, ErrProjectNotFound) ||
|
||||
errors.Is(err, ErrTaskNotFound) ||
|
||||
errors.Is(err, ErrColumnNotFound) ||
|
||||
errors.Is(err, ErrCommentNotFound)
|
||||
errors.Is(err, ErrCommentNotFound) ||
|
||||
errors.Is(err, ErrCategoryNotFound)
|
||||
}
|
||||
|
||||
// IsUnauthorized returns true if the error indicates an authentication failure.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue