mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-17 11:59:30 +00:00
API allow to create closed milestones (#11745)
* API allow to create closed milestones * set CloseDate too Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
19db3f4f0a
commit
1ac46186ff
4 changed files with 28 additions and 0 deletions
|
@ -144,6 +144,11 @@ func CreateMilestone(ctx *context.APIContext, form api.CreateMilestoneOption) {
|
|||
DeadlineUnix: timeutil.TimeStamp(form.Deadline.Unix()),
|
||||
}
|
||||
|
||||
if form.State == "closed" {
|
||||
milestone.IsClosed = true
|
||||
milestone.ClosedDateUnix = timeutil.TimeStampNow()
|
||||
}
|
||||
|
||||
if err := models.NewMilestone(milestone); err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "NewMilestone", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue