Skip to content
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

Support for car brands #54

Open
bcaure opened this issue Aug 16, 2019 · 0 comments
Open

Support for car brands #54

bcaure opened this issue Aug 16, 2019 · 0 comments

Comments

@bcaure
Copy link

bcaure commented Aug 16, 2019

I tried search with following values:

search.setFilter(leboncoin.FILTERS.ALL)
        .setCategory("voitures")
        .setRegion("ile_de_france")
        .addSearchExtra('brand', ["0", "Bmw"]);

It throws error:

node_modules\leboncoin-api\lib\search.js:248
            searchLabel = searchId[0].value;
                                      ^

TypeError: Cannot read property 'value' of undefined

I think it comes from the "groups" intermediate property in subcategories.json, unless I miss something?

  "2": {
    "brand": {
      "groups": [
        {
          "label": "Marques Courantes",
          "values": [
            {
              "label": "Audi",
              "value": "Audi"
            },
...
        {
          "label": "Autres Marques",
          "values": [
            {
              "label": "Abarth",
              "value": "Abarth"
            },

I think "Marques Courantes" and "Autres Marques" could be merged to solve this.
Otherwise I've made a quickfix, let me know if you want a merge request.

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

No branches or pull requests

2 participants