-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mailroom contact search API #213
Conversation
Codecov Report
@@ Coverage Diff @@
## master #213 +/- ##
=========================================
Coverage ? 47.78%
=========================================
Files ? 82
Lines ? 7212
Branches ? 0
=========================================
Hits ? 3446
Misses ? 3231
Partials ? 535
Continue to review full report at Codecov.
|
@@ -71,7 +71,7 @@ To run the tests you need to create the test database: | |||
|
|||
``` | |||
$ createdb mailroom_test | |||
$ createuser -P -E temba (set no password) | |||
$ createuser -P -E -s mailroom_test (set no password) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new machines have you discover things!
{"term":{"is_active":true}}, | ||
{"term":{"is_blocked":false}}, | ||
{"term":{"is_stopped":false}} | ||
{ "bool":{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Queries are a bit different now since the building of the root query doesn't force blocked
and stopped
anymore. (since those are valid searches)
} | ||
|
||
// Error is used when an error is in the parsing of a field or query format | ||
type Error struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
search.Error
is the type for search errors that should be shown to the user and are therefore (400 status errors). All other types of errors will result in the contact search endpoint returning a 500 (IE, elastic is unreachable)
search/search_test.go
Outdated
} | ||
|
||
resolver := func(key string) assets.Field { | ||
return registry[key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obviously doesn't matter in this case but my eyes have been trained to spot stuff like this (if item does't exist, nil struct gets wrapped in non-nil interface)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ya, I'm not as trained to look for those yet, thanks for the reminder.
Fix to use DLRID for Bongolive status reports
Read template components from components list field
Adds new endpoint to search for contacts within an org given a root group and the query. Returns the page of contact ids required, total number of hits and parsed query.