Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-26 03:36:10 +01:00
forgejo/routers/api/v1
Gergely Nagy be8d16438a
Fix /api/v1/{owner}/{repo}/issue_templates
When issue templates were moved into services in
def4956122, the code was also refactored
and simplified. Unfortunately, that simplification broke the
`/api/v1/{owner}/{repo}/issue_templates` route, because it was
previously using a helper function that ignored invalid templates, and
after the refactor, the function it called *always* returned non-nil as
the second return value. This, in turn, results in the aforementioned
end point always returning an internal server error.

This change restores the previous behaviour of ignoring invalid files
returned by `issue.GetTemplatesFromDefaultBranch`, and adds a few test
cases to exercise the endpoint.

Other users of `GetTemplatesFromDefaultBranch` already ignore the second
return value, or handle it correctly, so no changes are necessary there.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-05 20:58:41 +01:00
..
activitypub More refactoring of db.DefaultContext (#27083) 2023-09-15 06:13:19 +00:00
admin Unify user update methods (#28733) 2024-02-04 13:29:09 +00:00
misc Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
notify Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
org Unify user update methods (#28733) 2024-02-04 13:29:09 +00:00
packages Another round of db.DefaultContext refactor (#27103) 2023-09-25 13:17:37 +00:00
repo Fix /api/v1/{owner}/{repo}/issue_templates 2024-02-05 20:58:41 +01:00
settings Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
shared [GITEA] API comment update routers/api/v1/shared/runners.go 2024-02-05 16:09:43 +01:00
swagger [GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments 2024-02-05 16:09:42 +01:00
user [GITEA] Adjust name of operation 2024-02-05 16:09:43 +01:00
utils Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
api.go [GITEA] DELETE /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment} 2024-02-05 16:09:43 +01:00