Task Comments #138
|
@ -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)
|
||||
|
|
|
@ -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{}
|
||||
|
|
Loading…
Reference in New Issue
Block a user