chore: update settings value types
This commit is contained in:
parent
e0dc8b2e13
commit
4fad0cafad
|
@ -1,6 +1,6 @@
|
|||
import { Action } from 'redux';
|
||||
|
||||
import { ISettings } from '../reducers/settings';
|
||||
import { ISettings, TSettings } from '../reducers/settings';
|
||||
import { SETTINGS } from './actionsTypes';
|
||||
|
||||
interface IAddSettings extends Action {
|
||||
|
@ -8,7 +8,7 @@ interface IAddSettings extends Action {
|
|||
}
|
||||
|
||||
interface IUpdateSettings extends Action {
|
||||
payload: { id: string; value: string };
|
||||
payload: { id: string; value: TSettings };
|
||||
}
|
||||
|
||||
export type IActionSettings = IAddSettings & IUpdateSettings;
|
||||
|
@ -20,7 +20,7 @@ export function addSettings(settings: ISettings): IAddSettings {
|
|||
};
|
||||
}
|
||||
|
||||
export function updateSettings(id: string, value: string): IUpdateSettings {
|
||||
export function updateSettings(id: string, value: TSettings): IUpdateSettings {
|
||||
return {
|
||||
type: SETTINGS.UPDATE,
|
||||
payload: { id, value }
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { IActionSettings } from '../actions/settings';
|
||||
import { SETTINGS } from '../actions/actionsTypes';
|
||||
|
||||
// TODO UPDATE SETTINGS TYPE
|
||||
export type ISettings = Record<string, any>;
|
||||
export type TSettings = string | number | boolean;
|
||||
|
||||
export type ISettings = Record<string, TSettings>;
|
||||
|
||||
export const initialState: ISettings = {};
|
||||
|
||||
|
|
Loading…
Reference in New Issue