Skip to content

Commit

Permalink
fixed only apply filter
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiKaestle committed Nov 24, 2024
1 parent 54035c3 commit 23724b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions models/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ func (i *EventQuery) PublicFilter() bson.D {
filter.GteInt64("start_at", i.StartAt)
filter.LteInt64("end_at", i.EndAt)
if i.OnlyApply {
filter.GteInt64("application.start_date", strconv.FormatInt(time.Now().Unix(), 10))
filter.LteInt64("application.end_date", strconv.FormatInt(time.Now().Unix(), 10))
filter.LteInt64("application.start_date", strconv.FormatInt(time.Now().Unix(), 10))
filter.GteInt64("application.end_date", strconv.FormatInt(time.Now().Unix(), 10))
}
filter.GteInt64("modified.updated", i.UpdatedFrom)
filter.GteInt64("modified.created", i.CreatedFrom)
Expand Down Expand Up @@ -603,8 +603,8 @@ func (i *EventQuery) PermittedFilter(token *AccessToken) bson.D {
filter.Append(bson.E{Key: "$or", Value: bson.A{noCrewMatch.Bson(), crewMatch.Bson()}})
}
if i.OnlyApply {
filter.GteInt64("application.start_date", strconv.FormatInt(time.Now().Unix(), 10))
filter.LteInt64("application.end_date", strconv.FormatInt(time.Now().Unix(), 10))
filter.LteInt64("application.start_date", strconv.FormatInt(time.Now().Unix(), 10))
filter.GteInt64("application.end_date", strconv.FormatInt(time.Now().Unix(), 10))
}
if i.MissingApplications {
filter.Append(bson.E{Key: "$expr", Value: bson.D{{Key: "$gt", Value: bson.A{"$application.supporter_count", "$applications.confirmed"}}}})
Expand Down

0 comments on commit 23724b6

Please sign in to comment.