almost there but tasks dont disappear in UI and click&drag doesnt work
This commit is contained in:
@@ -2,11 +2,12 @@ package list
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"local/todo-server/server/ajax/form"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type List struct {
|
||||
ID string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
UUID string `json:"id"`
|
||||
Sort int `json:"sort"`
|
||||
Published int `json:"published"`
|
||||
@@ -16,49 +17,39 @@ type List struct {
|
||||
}
|
||||
|
||||
func New(r *http.Request) (*List, error) {
|
||||
return &List{}, errors.New("not impl")
|
||||
name := form.Get(r, "name")
|
||||
if name == "" {
|
||||
return nil, errors.New("no name given")
|
||||
}
|
||||
return &List{
|
||||
Name: name,
|
||||
UUID: form.NewUUID(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (l *List) loadLists() error {
|
||||
return errors.New("not impl")
|
||||
func (l *List) SetName(name string) {
|
||||
l.Name = name
|
||||
}
|
||||
|
||||
func (l *List) changeOrder() error {
|
||||
return errors.New("not impl")
|
||||
func (l *List) SetPublished(state bool) {
|
||||
set(state, &l.Published)
|
||||
}
|
||||
|
||||
func (l *List) addList() error {
|
||||
return errors.New("not impl")
|
||||
func (l *List) SetShowCompl(state bool) {
|
||||
set(state, &l.ShowCompl)
|
||||
}
|
||||
|
||||
func (l *List) renameList() error {
|
||||
return errors.New("not impl")
|
||||
func (l *List) SetShowNotes(state bool) {
|
||||
set(state, &l.ShowNotes)
|
||||
}
|
||||
|
||||
func (l *List) deleteList() error {
|
||||
return errors.New("not impl")
|
||||
func (l *List) SetHideList(state bool) {
|
||||
set(state, &l.Hidden)
|
||||
}
|
||||
|
||||
func (l *List) setSort() error {
|
||||
return errors.New("not impl")
|
||||
}
|
||||
|
||||
func (l *List) publishList() error {
|
||||
return errors.New("not impl")
|
||||
}
|
||||
|
||||
func (l *List) changeListOrder() error {
|
||||
return errors.New("not impl")
|
||||
}
|
||||
|
||||
func (l *List) clearCompletedInList() error {
|
||||
return errors.New("not impl")
|
||||
}
|
||||
|
||||
func (l *List) setShowNotesInList() error {
|
||||
return errors.New("not impl")
|
||||
}
|
||||
|
||||
func (l *List) setHideList() error {
|
||||
return errors.New("not impl")
|
||||
func set(b bool, i *int) {
|
||||
*i = 1
|
||||
if !b {
|
||||
*i = 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user