import _ from 'lodash';
import { requestApi } from 'lib/requestApi';

const api = {
    read,
};

_.set(window.ya.connect, 'api.suggest', api);

export default api;

function read(text, limit) {
    const query = { group_type: 'generic', text, limit };

    return requestApi('GET', 'suggest', { query });
}
