-
Notifications
You must be signed in to change notification settings - Fork 1
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
#162727478 Add search functionality #40
#162727478 Add search functionality #40
Conversation
A user can search for an art by its category A user can search for an art by keyword A user can search for other users by their firstname and lastname [Finishes #162727478]
Fix merge conflict [Fixes #162727478]
@@ -0,0 +1,69 @@ | |||
import chai from 'chai'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
@@ -0,0 +1,22 @@ | |||
import express from 'express'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
@@ -0,0 +1,185 @@ | |||
import { Op } from 'sequelize'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
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.
Looks good to me
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.
Looks good
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.
Looks Good
src/controllers/SearchController.js
Outdated
* @memberof SearchController | ||
* @returns {object} arts matching the specified category | ||
*/ | ||
static async searchByCategory(req, res) { |
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.
This is searching by the category id. Searching is mostly done by name or title
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.
Yes, so the idea is on the frontend the users get to see the category URL but on the backend, the id is being queried.
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.
Then the function should be named differently. Something like getArtsByCategory
.
Please look at the comment and fix the merge conflict @daniellamarr |
Resolve merge conflict [Fixes #162727478]
Apply TTL feedback [Fixes #162727478]
…github.com/andela/merry-ah-backend into feature/162727478/add-search-functionality
What does this PR do?
Description of Task to be completed?
How should this be manually tested?
npm install
, thennpm start
/api/v1/search/categories/:categoryId
to search arts based on the category id passed./api/v1/search/:keyword
to search arts based on the keyword passed./api/v1/search/users/:user
to search for available users on the platform.Any background context you want to provide?
What are the relevant pivotal tracker stories?
#162727478
Screenshots (if appropriate)
Questions:
N/A