gitea/services/issue
wxiaoguang ee242a08e9
Refactor issue template parsing and fix API endpoint (#29069)
The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate,
map[string]error)` doesn't really follow Golang's habits, then the
second returned value might be misused. For example, the API function
`GetIssueTemplates` incorrectly checked the second returned value and
always responds 500 error.

This PR refactors GetTemplatesFromDefaultBranch to
ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes the
API endpoint bug, and adds some tests.

And by the way, add proper prefix `X-` for the header generated in
`checkDeprecatedAuthMethods`, because non-standard HTTP headers should
have `X-` prefix, and it is also consistent with the new code in
`GetIssueTemplates`
2024-02-12 05:04:10 +00:00
..
assignee_test.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
assignee.go
comments.go More db.DefaultContext refactor (#27265) 2023-09-29 12:12:54 +00:00
commit_test.go
commit.go
content.go More db.DefaultContext refactor (#27265) 2023-09-29 12:12:54 +00:00
issue_test.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
issue.go Avoid run change title process when the title is same (#27467) 2023-10-06 18:00:53 +00:00
label_test.go
label.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
main_test.go
milestone_test.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
milestone.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
status.go
template.go Refactor issue template parsing and fix API endpoint (#29069) 2024-02-12 05:04:10 +00:00