mirror of
https://github.com/simon987/task_tracker.git
synced 2025-04-19 18:16:45 +00:00
Update project version
This commit is contained in:
parent
67c67090cf
commit
31359b1770
@ -155,6 +155,7 @@ type UpdateProjectRequest struct {
|
||||
Paused bool `json:"paused"`
|
||||
AssignRate rate.Limit `json:"assign_rate"`
|
||||
SubmitRate rate.Limit `json:"submit_rate"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
func (req *UpdateProjectRequest) isValid(pid int64) bool {
|
||||
|
@ -178,6 +178,7 @@ func (api *WebAPI) UpdateProject(r *Request) {
|
||||
Paused: updateReq.Paused,
|
||||
AssignRate: updateReq.AssignRate,
|
||||
SubmitRate: updateReq.SubmitRate,
|
||||
Version: updateReq.Version,
|
||||
}
|
||||
sess := api.Session.StartFasthttp(r.Ctx)
|
||||
manager := sess.Get("manager")
|
||||
|
@ -137,6 +137,7 @@ func TestUpdateProjectValid(t *testing.T) {
|
||||
Paused: true,
|
||||
AssignRate: 1,
|
||||
SubmitRate: 2,
|
||||
Version: "VersionB",
|
||||
}, pid, testAdminCtx)
|
||||
|
||||
if updateResp.Ok != true {
|
||||
@ -157,6 +158,9 @@ func TestUpdateProjectValid(t *testing.T) {
|
||||
if proj.Project.GitRepo != "GitRepoB" {
|
||||
t.Error()
|
||||
}
|
||||
if proj.Project.Version != "VersionB" {
|
||||
t.Error()
|
||||
}
|
||||
if proj.Project.Priority != 2 {
|
||||
t.Error()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user