1
0
Fork 0
forked from forgejo/forgejo

Add an updated_at field to the API call for issue's comment edition

The update date is used as the comment update date, and is applied to
the issue as an update date.
This commit is contained in:
fluzz 2023-07-20 11:35:10 +02:00
parent 76c8faecdc
commit cf787ad7fd
5 changed files with 29 additions and 4 deletions

View file

@ -1106,9 +1106,12 @@ func UpdateComment(c *Comment, doer *user_model.User) error {
return err
}
defer committer.Close()
sess := db.GetEngine(ctx)
if _, err := sess.ID(c.ID).AllCols().Update(c); err != nil {
sess := db.GetEngine(ctx).ID(c.ID).AllCols()
if c.Issue.NoAutoTime {
c.UpdatedUnix = c.Issue.UpdatedUnix
sess = sess.NoAutoTime()
}
if _, err := sess.Update(c); err != nil {
return err
}
if err := c.LoadIssue(ctx); err != nil {