gitea/routers/api/v1/repo
wxiaoguang dd8bc1d61d
Refactor issue template parsing and fix API endpoint (#29069) (#29140)
Backport #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-14 01:32:31 +00:00
..
action.go
avatar.go
blob.go
branch.go Also sync DB branches on push if necessary (#28361) (#28403) 2023-12-11 06:16:56 +00:00
collaborators.go More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
commits.go
file.go
fork.go
git_hook.go
git_ref.go
hook_test.go
hook.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
issue_attachment.go
issue_comment_attachment.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
issue_comment.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
issue_dependency.go Fix issue dependencies (#27736) (#28776) 2024-01-12 23:29:22 +02:00
issue_label.go Don't let API add 2 exclusive labels from same scope (#27433) (#27460) 2023-10-06 05:06:31 +08:00
issue_pin.go
issue_reaction.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
issue_stopwatch.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
issue_subscription.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
issue_tracked_time.go
issue.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
key.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
label.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
language.go
main_test.go
migrate.go
milestone.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
mirror.go Add RemoteAddress to mirrors (#26952) 2023-09-16 16:03:02 +00:00
notes.go api: GetPullRequestCommits: return file list (#27483) (#27539) 2023-10-09 14:21:35 +02:00
patch.go
pull_review.go More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
pull.go api: GetPullRequestCommits: return file list (#27483) (#27539) 2023-10-09 14:21:35 +02:00
release_attachment.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
release_tags.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
release.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
repo_test.go
repo.go Refactor issue template parsing and fix API endpoint (#29069) (#29140) 2024-02-14 01:32:31 +00:00
star.go
status.go Fix GetCommitStatuses (#28787) (#28804) 2024-01-15 19:30:12 +01:00
subscriber.go
tag.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
teams.go
topic.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
transfer.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
tree.go
wiki.go Fix an actions schedule bug (#28942) (#28999) 2024-01-31 15:52:31 +00:00