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