Add order to tasks and lists

This commit is contained in:
Bel LaPointe
2019-11-25 12:57:47 -07:00
parent f2e3a71348
commit 48e8b91039
6 changed files with 29 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ type List struct {
ShowCompl int `json:"showCompl"`
ShowNotes int `json:"showNotes"`
Hidden int `json:"hidden"`
Max int `json:"max"`
}
func New(r *http.Request) (*List, error) {
@@ -47,6 +48,11 @@ func (l *List) SetHideList(state bool) {
set(state, &l.Hidden)
}
func (l *List) NextIndex() int {
l.Max += 1
return l.Max
}
func set(b bool, i *int) {
*i = 1
if !b {