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

@@ -68,6 +68,14 @@ func (a *Ajax) makeTask(r *http.Request) (string, *task.Task, error) {
if err != nil {
return "", nil, err
}
list, err := a.storageGetList(listID)
if err != nil {
return "", nil, err
}
task.Index = list.NextIndex()
if err := a.storageSetList(list); err != nil {
return "", nil, err
}
task.AppendTags(tags)
return listID, task, nil
}