forgejo/routers
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
..
api Fix /api/v1/{owner}/{repo}/issue_templates 2024-02-05 20:58:41 +01:00
common Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
install [GITEA] Refactor generation of JWT secret 2024-02-05 16:54:44 +01:00
private [CLI] implement forgejo-cli 2024-02-05 13:33:58 +01:00
utils Improve user search display name (#29002) 2024-02-01 17:10:16 +00:00
web [GITEA] Allow changing the email address before activation (squash) 2024-02-05 16:57:58 +01:00
init.go [API] Forgejo API /api/forgejo/v1 2024-02-05 14:44:32 +01:00