MOBILE-3817 core: Cast site config to string to fix typing

main
Dani Palou 2022-09-20 12:13:00 +02:00
parent 5a3b4cfcb4
commit 566a0e5e43
1 changed files with 4 additions and 4 deletions

View File

@ -1967,16 +1967,16 @@ export class CoreSite {
// Return the requested setting.
for (const x in config.settings) {
if (config.settings[x].name == name) {
return config.settings[x].value;
return String(config.settings[x].value);
}
}
throw new CoreError('Site config not found: ' + name);
} else {
// Return all settings in the same array.
const settings = {};
const settings: CoreSiteConfig = {};
config.settings.forEach((setting) => {
settings[setting.name] = setting.value;
settings[setting.name] = String(setting.value);
});
return settings;
@ -2737,7 +2737,7 @@ export enum CoreSiteInfoUserHomepage {
export type CoreSiteConfigResponse = {
settings: { // Settings.
name: string; // The name of the setting.
value: string; // The value of the setting.
value: string | number; // The value of the setting.
}[];
warnings?: CoreWSExternalWarning[];
};