Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing string edge case at param loading #887

Merged
merged 2 commits into from
May 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/settings/SettingsThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const updateGlobalParametersThunk = (newParameters) => (dispatch: any, ge
try {
const { settings } = getState().dashboard;
const parameters = settings.parameters ? settings.parameters : {};

// if new parameters are set...
if (newParameters) {
// iterate over the key value pairs in parameters
Expand Down Expand Up @@ -91,8 +90,14 @@ export const updateParametersToNeo4jTypeThunk = () => (dispatch: any, getState:
// iterate over the key value pairs in parameters
Object.keys(parameters).forEach((key) => {
if (isCastableToNeo4jDate(parameters[key])) {
console.log(key, 'date');
mariusconjeaud marked this conversation as resolved.
Show resolved Hide resolved
parameters[key] = castToNeo4jDate(parameters[key]);
} else if (parameters[key] && typeof toNumber(parameters[key]) === 'number') {
} else if (
parameters[key] &&
!isNaN(toNumber(parameters[key])) &&
typeof toNumber(parameters[key]) === 'number'
) {
console.log(key, 'number');
mariusconjeaud marked this conversation as resolved.
Show resolved Hide resolved
parameters[key] = toNumber(parameters[key]);
} else if (parameters[key] == undefined) {
delete parameters[key];
Expand Down
Loading