MOBILE-3817 core: Cast site config to string to fix typing
This commit is contained in:
		
							parent
							
								
									5a3b4cfcb4
								
							
						
					
					
						commit
						566a0e5e43
					
				@ -1967,16 +1967,16 @@ export class CoreSite {
 | 
				
			|||||||
                // Return the requested setting.
 | 
					                // Return the requested setting.
 | 
				
			||||||
                for (const x in config.settings) {
 | 
					                for (const x in config.settings) {
 | 
				
			||||||
                    if (config.settings[x].name == name) {
 | 
					                    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);
 | 
					                throw new CoreError('Site config not found: ' + name);
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                // Return all settings in the same array.
 | 
					                // Return all settings in the same array.
 | 
				
			||||||
                const settings = {};
 | 
					                const settings: CoreSiteConfig = {};
 | 
				
			||||||
                config.settings.forEach((setting) => {
 | 
					                config.settings.forEach((setting) => {
 | 
				
			||||||
                    settings[setting.name] = setting.value;
 | 
					                    settings[setting.name] = String(setting.value);
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return settings;
 | 
					                return settings;
 | 
				
			||||||
@ -2737,7 +2737,7 @@ export enum CoreSiteInfoUserHomepage {
 | 
				
			|||||||
export type CoreSiteConfigResponse = {
 | 
					export type CoreSiteConfigResponse = {
 | 
				
			||||||
    settings: { // Settings.
 | 
					    settings: { // Settings.
 | 
				
			||||||
        name: string; // The name of the setting.
 | 
					        name: string; // The name of the setting.
 | 
				
			||||||
        value: string; // The value of the setting.
 | 
					        value: string | number; // The value of the setting.
 | 
				
			||||||
    }[];
 | 
					    }[];
 | 
				
			||||||
    warnings?: CoreWSExternalWarning[];
 | 
					    warnings?: CoreWSExternalWarning[];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user