Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Update customer search functionality to allow searching for Customer by Status. #134

Merged
merged 2 commits into from
Sep 2, 2020

Conversation

jmbrown412
Copy link

@jmbrown412 jmbrown412 commented Sep 2, 2020

This PR updates the search functionality for Customers to allow searching by Status.

Issue: #128

@@ -101,5 +103,9 @@ func buildSearchQuery(params searchParams) (string, []interface{}) {
query += " and lower(email) like ?"
args = append(args, "%"+strings.ToLower(params.Email))
}
if params.Status != "" {
query += " and status like ?"
args = append(args, "%"+strings.ToLower(params.Status))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to double toLower since we do it up above when we create the params.

Copy link
Author

@jmbrown412 jmbrown412 Sep 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I removed them for all of the query params.

@codecov-commenter
Copy link

Codecov Report

Merging #134 into master will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
- Coverage   62.20%   62.18%   -0.03%     
==========================================
  Files          36       36              
  Lines        1982     1986       +4     
==========================================
+ Hits         1233     1235       +2     
- Misses        530      531       +1     
- Partials      219      220       +1     

@jmbrown412 jmbrown412 merged commit 8e383e4 into master Sep 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants