c-topherl / brewCom

0 stars 0 forks source link

get_products #26

Closed c-topherl closed 8 years ago

c-topherl commented 8 years ago

-SELECT statement is being echo'd... stop that

-What are all the number keys for each product object? Examples below:

"prod_code":"zoe","0":"zoe", "class_code":"apolo","3":"apolo" "prod_desc":"joels favorite beer","1":"joels favorite beer"

Every attribute has a number key after it with a duplicate value.

-Should probably use somewhat realistic data if we're going to be showing this soon...

c-topherl commented 8 years ago

http://joelmeister.net/brewCom/controllers/product_controller.php?function=get_products

c-topherl commented 8 years ago

-Need unit in each product object

Good practice note: should really have array of products inside responseData object. Not sure how handlebars is going to handle the nested objects here.. guess we'll find out.

{ responseData: { products: [ {product 1} {product 2} ] }

joelmeister commented 8 years ago

I have no idea what the number field is doing there. I'll look in to it. getproducts has been updated to return like your last comment, just need to do the other get* functions.

joelmeister commented 8 years ago

Also, you should be requesting ?function=get_product_units because that is the table that has all of the combinations.

c-topherl commented 8 years ago

Any way we can substitute the nulls for empty strings? I think handlebars will take the string "null" and plug it in... we'll see though. Maybe not cuz there isn't quotes around it?

http://joelmeister.net/brewCom/controllers/product_controller.php?function=get_product_units

joelmeister commented 8 years ago

That column is defined as NOT NULL, I just was messing around with bad data. I updated that particular one so it should be fine now.