Skip to content

Commit

Permalink
fix: setting prefs are correcly updated
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoGottardi committed Jul 22, 2024
1 parent aa1131e commit cd29937
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/views/settings/save-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ function getRequestForProps(props: PropsMods | undefined, appId: string): string
: '';
}

function getRequestForPrefs(prefs: PrefsMods | undefined): string {
return prefs
? `<ModifyPrefsRequest xmlns="urn:zimbraAccount">${map(
prefs,
(value, key) => `<pref name="${key}">${value}</pref>`
).join('')}</ModifyPrefsRequest>`
: '';
}

function getRequestForAmavisSendersListAttrs(attrs: AttrsMods | undefined): string {
return attrs?.amavisWhitelistSender || attrs?.amavisBlacklistSender
? `<ModifyWhiteBlackListRequest xmlns="urn:zimbraAccount">${
Expand Down Expand Up @@ -94,6 +103,7 @@ export const saveSettings = (
'Batch',
`<BatchRequest xmlns="urn:zimbra" onerror="stop">
${getRequestForProps(mods.props, appId)}
${getRequestForPrefs(mods.prefs)}
${getRequestForAmavisSendersListAttrs(mods.attrs)}
${getRequestForIdentities(mods.identity)}
</BatchRequest>`
Expand Down

0 comments on commit cd29937

Please sign in to comment.