mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 16:40:52 +00:00
Backport #27265 by @JakobDev Part of #27065 This PR touches functions used in templates. As templates are not static typed, errors are harder to find, but I hope I catch it all. I think some tests from other persons do not hurt. Co-authored-by: JakobDev <jakobdev@gmx.de>
This commit is contained in:
parent
84ee02faa7
commit
f13a294b47
66 changed files with 455 additions and 456 deletions
|
@ -19,9 +19,9 @@ func ToAPIComment(ctx context.Context, repo *repo_model.Repository, c *issues_mo
|
|||
return &api.Comment{
|
||||
ID: c.ID,
|
||||
Poster: ToUser(ctx, c.Poster, nil),
|
||||
HTMLURL: c.HTMLURL(),
|
||||
IssueURL: c.IssueURL(),
|
||||
PRURL: c.PRURL(),
|
||||
HTMLURL: c.HTMLURL(ctx),
|
||||
IssueURL: c.IssueURL(ctx),
|
||||
PRURL: c.PRURL(ctx),
|
||||
Body: c.Content,
|
||||
Attachments: ToAPIAttachments(repo, c.Attachments),
|
||||
Created: c.CreatedUnix.AsTime(),
|
||||
|
@ -37,19 +37,19 @@ func ToTimelineComment(ctx context.Context, repo *repo_model.Repository, c *issu
|
|||
return nil
|
||||
}
|
||||
|
||||
err = c.LoadAssigneeUserAndTeam()
|
||||
err = c.LoadAssigneeUserAndTeam(ctx)
|
||||
if err != nil {
|
||||
log.Error("LoadAssigneeUserAndTeam: %v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
err = c.LoadResolveDoer()
|
||||
err = c.LoadResolveDoer(ctx)
|
||||
if err != nil {
|
||||
log.Error("LoadResolveDoer: %v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
err = c.LoadDepIssueDetails()
|
||||
err = c.LoadDepIssueDetails(ctx)
|
||||
if err != nil {
|
||||
log.Error("LoadDepIssueDetails: %v", err)
|
||||
return nil
|
||||
|
@ -61,7 +61,7 @@ func ToTimelineComment(ctx context.Context, repo *repo_model.Repository, c *issu
|
|||
return nil
|
||||
}
|
||||
|
||||
err = c.LoadLabel()
|
||||
err = c.LoadLabel(ctx)
|
||||
if err != nil {
|
||||
log.Error("LoadLabel: %v", err)
|
||||
return nil
|
||||
|
@ -82,9 +82,9 @@ func ToTimelineComment(ctx context.Context, repo *repo_model.Repository, c *issu
|
|||
ID: c.ID,
|
||||
Type: c.Type.String(),
|
||||
Poster: ToUser(ctx, c.Poster, nil),
|
||||
HTMLURL: c.HTMLURL(),
|
||||
IssueURL: c.IssueURL(),
|
||||
PRURL: c.PRURL(),
|
||||
HTMLURL: c.HTMLURL(ctx),
|
||||
IssueURL: c.IssueURL(ctx),
|
||||
PRURL: c.PRURL(ctx),
|
||||
Body: c.Content,
|
||||
Created: c.CreatedUnix.AsTime(),
|
||||
Updated: c.UpdatedUnix.AsTime(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue