Set all settings to store when returned from server on save

[MAILPOET-2806]
This commit is contained in:
Jan Jakeš
2020-04-07 10:36:06 +02:00
committed by Veljko V
parent 0e40b820e5
commit 891c6c9aa7

View File

@@ -42,7 +42,7 @@ export function updateKeyActivationState(fields: Partial<KeyActivationState>): A
export function* saveSettings() {
yield { type: 'SAVE_STARTED' };
const data = select(STORE_NAME).getSettings();
const { success, error } = yield {
const { success, error, res } = yield {
type: 'CALL_API',
endpoint: 'settings',
action: 'set',
@@ -52,6 +52,7 @@ export function* saveSettings() {
return { type: 'SAVE_FAILED', error };
}
yield { type: 'TRACK_SETTINGS_SAVED' };
yield setSettings(res.data);
return { type: 'SAVE_DONE' };
}