Skip to content

Conversation

@SwatiChoudhary22
Copy link
Collaborator

No description provided.

search?: string
}
if (sortType !== 'asc' && sortType !== 'desc' && sortType !== undefined) {
return response.badRequest('Try again')
Copy link
Collaborator

Choose a reason for hiding this comment

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

the message should be more meaningful

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

let produsctsQuery = Product.query()
if (search) {
produsctsQuery = produsctsQuery.where((query) =>
query.where('Lower(title)', 'Like', `[%${search.toLowerCase}%]`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is incorrect....

  1. toLowerCase isn't begin called
    2, The last arg is supposed to be the string... here you have given [%<user_input>%] this will not match with anything ever
  2. first arg takes a col name .... which "Lower(title)" is not

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

okk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants