HashtagSell / posting-api

API for storage and retrieval of posting details for Hashtagsell
0 stars 0 forks source link

filter.optional.exact.categoryCode must have index greater than 1 #45

Closed that1guy closed 9 years ago

that1guy commented 9 years ago

Notice the comma that is necessary after the categoryCode. If the comma is not there we get error

This query works cause it has a comma
http://localhost:4043/v1/postings/?start=0&count=35&filters[mandatory][contains][heading]=macbook&filters[optional][exact][categoryCode]=SELE,&geo[coords]=-122.431297,37.773972&geo[min]=0&geo[max]=100000
This does not
http://localhost:4043/v1/postings/?start=0&count=35&filters[mandatory][contains][heading]=macbook&filters[optional][exact][categoryCode]=SELE&geo[coords]=-122.431297,37.773972&geo[min]=0&geo[max]=100000
Here is our error
{
  "name": "PersistenceError",
  "message": "unable to find postings",
  "sourceError": {
    "statusCode": 400
  },
  "statusCode": 500,
  "options": {
    "count": "35",
    "filters": {
      "mandatory": {
        "contains": {
          "heading": "macbook"
        }
      },
      "optional": {
        "exact": {
          "categoryCode": "SELE"
        }
      }
    },
    "geo": {
      "coords": [
        -122.431297,
        37.773972
      ],
      "min": 0,
      "max": 100000
    },
    "sort": {},
    "start": "0"
  }
}
brozeph commented 9 years ago

Resolved this with fixes introduced for #44