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 all commits
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
7 changes: 5 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 @@ -92,7 +91,11 @@ export const updateParametersToNeo4jTypeThunk = () => (dispatch: any, getState:
Object.keys(parameters).forEach((key) => {
if (isCastableToNeo4jDate(parameters[key])) {
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'
) {
parameters[key] = toNumber(parameters[key]);
} else if (parameters[key] == undefined) {
delete parameters[key];
Expand Down
Loading