Task Comments #138

Merged
konrad merged 18 commits from feature/comments into master 2020-02-19 21:57:57 +00:00
2 changed files with 17 additions and 0 deletions
Showing only changes of commit 199cfccd17 - Show all commits

View File

@ -19,6 +19,11 @@ package models
import "code.vikunja.io/web"
func (tc *TaskComment) CanRead(a web.Auth) (bool, error) {
t := Task{ID: tc.ID}
return t.CanRead(a)
}
func (tc *TaskComment) CanWrite(a web.Auth) (bool, error) {
t := Task{ID: tc.ID}
return t.CanWrite(a)

View File

@ -66,6 +66,18 @@ func (tc *TaskComment) Update() (err error) {
return
}
// ReadOne handles getting a single comment
func (tc *TaskComment) ReadOne() (err error) {
exists, err := x.Get(tc)
if err != nil {
return
}
if !exists {
// TODO
}
return
}
// ReadAll returns all comments for a task
func (tc *TaskComment) ReadAll(auth web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) {
comments := []*TaskComment{}