function mergeAndSaveSettings(table_setting_id, newTableSettings, automaticFeedback=true) { const settingName = 'ui.table_setting' const urlGet = `/user-settings/getMySettingByName/${settingName}` return AJAXApi.quickFetchJSON(urlGet).then(tableSettings => { tableSettings = JSON.parse(tableSettings.value) newTableSettings = mergeNewTableSettingsIntoOld(table_setting_id, tableSettings, newTableSettings) return saveTableSetting(settingName, newTableSettings, automaticFeedback) }).catch((e) => { // setting probably doesn't exist return saveTableSetting(settingName, newTableSettings, automaticFeedback) }) } function mergeAndSaveSettingsWithReload(table_setting_id, tableSettings, $table) { mergeAndSaveSettings(table_setting_id, tableSettings, false).then((apiResult) => { const theToast = UI.toast({ variant: 'success', title: apiResult.message, bodyHtml: $('
').append( $('').text('The table needs to be reloaded for the new fields to be included.'), $('