mirror of
https://github.com/nexus-stc/hyperboria
synced 2025-01-04 15:55:56 +01:00
19 lines
450 B
JavaScript
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
|
||
|
})
|
||
|
}
|
||
|
}
|