Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Adding advanced search for inventory for hlr api #373

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

trevren11
Copy link
Contributor

Allows to search several fields for use in the API.

query += " WHERE ";
var i = 0;
for (var item in params){
query += item + " ILIKE '%" + params[item] + "%'";
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a SQL query injection possible here; can you change this to use prepared statements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gar. Thanks for pointing that out. Yeah I will take care of that.

@trevren11
Copy link
Contributor Author

I am not going to lie, I am pretty sure I am out of ideas for this, I can't get anything to work reliably for the amount of variation we have from the search feature. Does anybody have any suggestions?

@webnard
Copy link
Contributor

webnard commented Jul 27, 2016

You could fake it by writing just a small database query to yank down certain items and then filter in the application code. I.e., select * from whatever join whatevs; with a items.filter( item => { return blah; })

What are the search features you're wanting to implement?

@trevren11
Copy link
Contributor Author

...that would probably be pretty easy actually. I might have a few questions later on but I might be able to get that working how we want it

@WorldsEndless
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants