Simplify project board API: use state field, extract helpers, remove dead code

- Replace separate POST /close and /reopen endpoints with a state field
  on EditProjectOption, matching the milestone and issue API patterns
- Extract getRepoProjectByID and getRepoProjectColumn helpers to
  deduplicate repeated lookup-and-error-handle patterns
- Use LoadIssueNumbersForProject (singular) for single-project handlers
- Remove unnecessary LoadIssueNumbersForProjects call on CreateProject
  since a new project always has zero issues
- Remove unnecessary WHAT comments
- Fix copyright year in routers/api/v1/repo/project.go

Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
This commit is contained in:
silverwind
2026-05-03 14:32:35 +05:30
committed by beardev-in
co-authored by Claude
parent 2e2ca07237
commit 95d2a05dd8
5 changed files with 78 additions and 282 deletions
+2
View File
@@ -49,6 +49,8 @@ type EditProjectOption struct {
Description *string `json:"description,omitempty"`
// Card type: 0=text_only, 1=images_and_text
CardType *int `json:"card_type,omitempty"`
// State of the project (open or closed)
State *string `json:"state,omitempty"`
}
// ProjectColumn represents a project column (board)