Fix assignee filter bug in List
This commit is contained in:
33
service/node_service.go
Normal file
33
service/node_service.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package service
|
||||
|
||||
import "axolotl/models"
|
||||
|
||||
type NodeService interface {
|
||||
Create(title, content, dueDate string, tags []string, rels map[models.RelType][]string) (*models.Node, error)
|
||||
Update(node *models.Node) error
|
||||
Delete(id string) error
|
||||
GetByID(id string) (*models.Node, error)
|
||||
List(opts ...ListOption) ([]*models.Node, error)
|
||||
Exists(id string) (bool, error)
|
||||
CanClose(id string) (bool, []string, error)
|
||||
}
|
||||
|
||||
type listFilter struct {
|
||||
tagPrefixes []string
|
||||
assignee string
|
||||
mentionsUser string
|
||||
}
|
||||
|
||||
type ListOption func(*listFilter)
|
||||
|
||||
func WithTags(prefixes ...string) ListOption {
|
||||
return func(f *listFilter) { f.tagPrefixes = prefixes }
|
||||
}
|
||||
|
||||
func WithAssignee(userID string) ListOption {
|
||||
return func(f *listFilter) { f.assignee = userID }
|
||||
}
|
||||
|
||||
func WithMentions(userID string) ListOption {
|
||||
return func(f *listFilter) { f.mentionsUser = userID }
|
||||
}
|
||||
Reference in New Issue
Block a user