Last active
November 15, 2016 10:48
-
-
Save pioh/df6ccb2b82a4cea2a908cb8b2f68a2f5 to your computer and use it in GitHub Desktop.
filterOffers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filterOffers: { // запрос | |
filter: { | |
price: { | |
from: 10, | |
to: 5000, | |
}, | |
realtyType: ['office'], | |
// ...остальные поля которые уже есть | |
limit: 10, // вернуть первые 10 объектов | |
offset: 30, // начиная с 30ого | |
sortBy: 'address', // отсортированные по address | |
reverse: true, // в обратном порядке | |
}, | |
fields: ['hid', 'address', 'price', 'space'], // вернуть только эти поля | |
} : { // ответ | |
offers: [...], // сами объекты | |
offsersCount: 435345, // общее количество объектов в базе по этому фильтру если отбросить limit, offset | |
} | |
// второй вариант запроса | |
filterOffers: { // запрос | |
filter: { | |
HIDs: ['asdasd', '123saqd1234', 'adsqweqwe'], | |
}, | |
fields: ['hid', 'address', 'price', 'space'], | |
} : { // ответ | |
offers: [...], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment