feat(SW-497): Changes to global alert schema

This commit is contained in:
Erik Tiekstra
2024-10-16 12:30:59 +02:00
parent 3f12246e12
commit c8d4f6c47c
8 changed files with 131 additions and 49 deletions

View File

@@ -67,9 +67,9 @@ import {
getSiteConfigSuccessCounter,
} from "./telemetry"
import {
getAlertPhoneContactData,
getConnections,
getFooterConnections,
getGlobalAlertPhoneContactData,
} from "./utils"
import type {
@@ -667,15 +667,15 @@ export const baseQueryRouter = router({
JSON.stringify({ query: { lang } })
)
const { globalAlert } = validatedSiteConfig.data
const { sitewideAlert } = validatedSiteConfig.data
return {
...validatedSiteConfig.data,
globalAlert: globalAlert
sitewideAlert: sitewideAlert
? {
...globalAlert,
...sitewideAlert,
phone_contact: contactConfig
? getGlobalAlertPhoneContactData(globalAlert, contactConfig)
? getAlertPhoneContactData(sitewideAlert, contactConfig)
: null,
}
: null,