Skip to content

Commit

Permalink
fix(events): correctly check keyword match
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed Aug 26, 2023
1 parent 950b308 commit 0cc1895
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/events/internal/grpc_impl/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import (
model "github.com/satont/twir/libs/gomodels"
)

func (c *EventsGrpcImplementation) processEvent(channelId string, data internal.Data, eventType model.EventType) error {
func (c *EventsGrpcImplementation) processEvent(
channelId string,
data internal.Data,
eventType model.EventType,
) error {
var dbEntities []model.Event

err := c.services.DB.
Expand Down Expand Up @@ -46,8 +50,8 @@ func (c *EventsGrpcImplementation) processEvent(channelId string, data internal.
}

if entity.Type == model.EventTypeKeywordMatched &&
data.RewardID != "" &&
entity.RewardID.Valid &&
data.KeywordID != "" &&
entity.KeywordID.Valid &&
data.KeywordID != entity.KeywordID.String {
continue
}
Expand Down

0 comments on commit 0cc1895

Please sign in to comment.