This commit is contained in:
@@ -54,6 +54,10 @@ func Project(g *gin.RouterGroup, db database.Database) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if project.Active && project.StatusTag != nil {
|
||||||
|
project.StatusTag = nil
|
||||||
|
}
|
||||||
|
|
||||||
return &models.ProjectResult{
|
return &models.ProjectResult{
|
||||||
Project: project,
|
Project: project,
|
||||||
Tasks: []*models.TaskResult{},
|
Tasks: []*models.TaskResult{},
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
-- +goose Up
|
||||||
|
-- +goose StatementBegin
|
||||||
|
UPDATE project SET status_tag=NULL WHERE active=true;
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
-- +goose StatementBegin
|
||||||
|
SELECT 'Nothing to do';
|
||||||
|
-- +goose StatementEnd
|
||||||
@@ -47,6 +47,10 @@ func (project *Project) Update(update ProjectUpdate) {
|
|||||||
if update.Favorite != nil {
|
if update.Favorite != nil {
|
||||||
project.Favorite = *update.Favorite
|
project.Favorite = *update.Favorite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if project.StatusTag != nil && !project.Active {
|
||||||
|
project.StatusTag = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProjectUpdate struct {
|
type ProjectUpdate struct {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
stuffLogClient.createProject({
|
stuffLogClient.createProject({
|
||||||
active: statusTag === "",
|
active: statusTag === "",
|
||||||
endTime: ( endTime == "" ) ? null : new Date(endTime),
|
endTime: ( endTime == "" ) ? null : new Date(endTime),
|
||||||
statusTag: statusTag || null,
|
statusTag: statusTag !== "" ? statusTag : null,
|
||||||
|
|
||||||
name, description, icon, favorite,
|
name, description, icon, favorite,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user