Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
this.trainCounter = 0;
this.albumsArray = albumsArray;
this.api = apisearch(credentials);
this.ui = apisearchUI(credentials);
}
ResultActions_1.configureQuery(props.environmentId, props.currentQuery, props.itemsPerPage, props.highlightsEnabled, props.promote.map(function (itemUUID) {
return itemUUID instanceof ItemUUID_1.ItemUUID
? itemUUID
: ItemUUID_1.ItemUUID.createFromArray(itemUUID);
}), props.exclude.map(function (itemUUID) {
return itemUUID instanceof ItemUUID_1.ItemUUID
ResultActions_1.configureQuery(props.environmentId, props.currentQuery, props.itemsPerPage, props.highlightsEnabled, props.promote.map(function (itemUUID) {
return itemUUID instanceof ItemUUID_1.ItemUUID
? itemUUID
: ItemUUID_1.ItemUUID.createFromArray(itemUUID);
}), props.exclude.map(function (itemUUID) {
return itemUUID instanceof ItemUUID_1.ItemUUID
super();
/**
* Store initial state
*/
this.dirty = true;
/**
* Current query instance
*/
this.currentQuery = apisearch.createQueryMatchAll();
/**
* Data received
*/
this.currentResult = apisearch.createEmptyResult();
}
export function onChangeSearchAction(
environmentId: string,
currentQuery: Query,
repository: Repository,
selectedOption: string,
) {
const clonedQuery = cloneDeep(currentQuery);
const filterData = splitQueryValue(selectedOption);
clonedQuery
.sortBy(Apisearch
.createEmptySortBy()
.byFieldValue(
filterData.field,
filterData.sort,
),
);
clonedQuery.page = 1;
const dispatcher = container.get(`${APISEARCH_DISPATCHER}__${environmentId}`);
repository
.query(clonedQuery)
.then((result) => {
dispatcher.dispatch({
type: "RENDER_FETCHED_DATA",
payload: {
constructor() {
super();
/**
* Store initial state
*/
this.dirty = true;
/**
* Current query instance
*/
this.currentQuery = apisearch.createQueryMatchAll();
/**
* Data received
*/
this.currentResult = apisearch.createEmptyResult();
}
container.register(repositoryId, () => {
return apisearch.createRepository(config);
});
public static create(config: any): ApisearchUI {
apisearch.ensureRepositoryConfigIsValid(config);
/**
* Build environment Id
*/
const environmentId = createEnvironmentId();
/**
* Bootstrapping ApisearchUI application
*/
bootstrap(
environmentId,
config,
);
/**
* Register handleActions method (store reducer)
props.exclude.map((itemUUID) => {
return itemUUID instanceof ItemUUID
? itemUUID
: ItemUUID.createFromArray(itemUUID)
}),
props.fields,