Skip to content

Commit

Permalink
RC #291 - Adding "range" to Typesense utils; Adding additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dleadbetter committed Aug 14, 2024
1 parent b719e12 commit 999c941
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/core-data/src/utils/Typesense.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const createRouting = (config: TypesenseConfig) => ({
stateMapping: {
stateToRoute: (state: any) => {
const uiState = state[config.index_name] || {};
const { refinementList } = uiState;
const { range, refinementList } = uiState;

console.log(uiState);

Expand All @@ -54,12 +54,21 @@ const createRouting = (config: TypesenseConfig) => ({
};
}

if (range) {
route = {
...route,
...range
};
}

return route;
},

routeToState: (state: any) => {
const { q, ...facets } = state;

console.log(state);

const uiState = {
[config.index_name]: {
query: q,
Expand Down

0 comments on commit 999c941

Please sign in to comment.