Release 2.8.1
This commit is contained in:
@@ -165,11 +165,19 @@ async function saveAppSettings(pool, settings, modifiedBy) {
|
||||
if (!Object.prototype.hasOwnProperty.call(inputSettings, definition.key)) {
|
||||
continue;
|
||||
}
|
||||
await connection.query(
|
||||
`UPDATE o_app_settings
|
||||
SET setting_value = ?, modified_by = ?
|
||||
WHERE setting_key = ?`,
|
||||
[JSON.stringify(normalizedSettings[definition.key]), modifiedBy || null, definition.key]
|
||||
);
|
||||
await connection.query(
|
||||
`INSERT INTO o_app_settings (setting_key, setting_value, created_by, modified_by)
|
||||
VALUES (?, ?, ?, ?)
|
||||
ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value), modified_by = VALUES(modified_by)`,
|
||||
[definition.key, JSON.stringify(normalizedSettings[definition.key]), modifiedBy || null, modifiedBy || null]
|
||||
SELECT ?, ?, ?, ?
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM o_app_settings WHERE setting_key = ?
|
||||
)`,
|
||||
[definition.key, JSON.stringify(normalizedSettings[definition.key]), modifiedBy || null, modifiedBy || null, definition.key]
|
||||
);
|
||||
}
|
||||
if (typeof connection.commit === 'function') {
|
||||
|
||||
Reference in New Issue
Block a user