(key: string, value: string)
| 27 | |
| 28 | // Define a helper function to update config values |
| 29 | const setConfigValue = (key: string, value: string): void => { |
| 30 | for (const config of props.configData) { |
| 31 | if (config.key === key) { |
| 32 | props.configCollection.update(config.id, (draft) => { |
| 33 | draft.value = value |
| 34 | }) |
| 35 | return |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | // If the config doesn't exist yet, create it |
| 40 | props.configCollection.insert({ |
| 41 | id: Math.round(Math.random() * 1000000), |
| 42 | key, |
| 43 | value, |
| 44 | created_at: new Date(), |
| 45 | updated_at: new Date(), |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | const backgroundColor = getConfigValue(`backgroundColor`) |
| 50 |
no test coverage detected