Skip to content

Commit

Permalink
Implement Distinct() method in ModelFilter class (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sundava authored and geoffreybauduin committed Oct 31, 2019
1 parent 7f7cab7 commit 6a4c4d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 0 additions & 9 deletions testdata/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ func NewPostFilter() *PostFilter {
return &PostFilter{}
}

func (f *PostFilter) AddOption(opt yaormfilter.RequestOption) yaormfilter.Filter {
f.AddOption_(opt)
return f
}

func (f *PostFilter) Distinct() {
f.AddOption("SelectDistinct")
}

func (f *PostFilter) ID(v yaormfilter.ValueFilter) *PostFilter {
f.FilterID = v
return f
Expand Down
4 changes: 4 additions & 0 deletions yaormfilter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ func (mf *ModelFilter) GetSelectOptions() []RequestOption {
return opts
}

func (mf *ModelFilter) Distinct() {
mf.AddOption_("SelectDistinct")
}

func (mf *ModelFilter) Limit(limit uint64) Filter {
panic(errors.NotImplementedf("Limit"))
}
Expand Down

0 comments on commit 6a4c4d2

Please sign in to comment.