add favorite system and other small tweaks and fixes.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-02-27 16:47:57 +01:00
parent 48b439af4f
commit 16237a89a4
20 changed files with 147 additions and 39 deletions
+6
View File
@@ -15,6 +15,7 @@ type Project struct {
CreatedTime time.Time `json:"createdTime" db:"created_time"`
EndTime *time.Time `json:"endTime" db:"end_time"`
StatusTag *string `json:"statusTag" db:"status_tag"`
Favorite bool `json:"favorite" db:"favorite"`
}
func (project *Project) Update(update ProjectUpdate) {
@@ -43,6 +44,9 @@ func (project *Project) Update(update ProjectUpdate) {
if update.ClearStatusTag {
project.StatusTag = nil
}
if update.Favorite != nil {
project.Favorite = *update.Favorite
}
}
type ProjectUpdate struct {
@@ -54,6 +58,7 @@ type ProjectUpdate struct {
ClearEndTime bool `json:"clearEndTime"`
StatusTag *string `json:"statusTag"`
ClearStatusTag bool `json:"clearStatusTag"`
Favorite *bool `json:"favorite"`
}
type ProjectResult struct {
@@ -64,6 +69,7 @@ type ProjectResult struct {
type ProjectFilter struct {
UserID string
Active *bool
Favorite *bool
Expiring bool
IDs []string
}