hyperboria/nexus/cognitron/web/client/http-client.js
the-superpirate d51e5ab65d - fix: Various fixes for release
- fix: Translation fixes
- fix: Various fixes
- feat: PB translations, configuration changes
- fix: Bugfixes

GitOrigin-RevId: 55f8b148c42a296162fc707c36a5146ca0073b4b
2021-01-29 11:26:51 +03:00

19 lines
450 B
JavaScript

export default class HttpClient {
search (schema, text, page, itemsPerPage) {
const params = new URLSearchParams()
params.append('query', text)
if (page) {
params.append('page', page)
}
if (itemsPerPage) {
params.append('page_size', itemsPerPage)
}
const url = '/v1/' + schema + '/search/?' + params
return this.nativeClient.request({
method: 'get',
url: url,
cache: false
})
}
}