initial launch
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { FormMode } from '../../enums/formMode';
|
||||
import { ProjectsState } from './ProjectsState.interface'
|
||||
import { Project } from './Project.interface';
|
||||
import { Alert } from '../../interfaces';
|
||||
|
||||
type Action =
|
||||
| {
|
||||
@@ -11,7 +12,7 @@ type Action =
|
||||
};
|
||||
}
|
||||
| { type: 'SET_PROJECTS'; payload: Project[] }
|
||||
| { type: 'SET_ERROR'; payload: string | undefined }
|
||||
| { type: 'SET_ALERT'; payload: Alert | undefined }
|
||||
| { type: 'SET_FORM_MODE'; payload: FormMode }
|
||||
| { type: 'SET_IS_CONFIRMATION_DIALOG_LOADING'; payload: boolean }
|
||||
| { type: 'SET_IS_LOADING'; payload: boolean }
|
||||
@@ -25,13 +26,13 @@ type Action =
|
||||
};
|
||||
|
||||
export const initialState: ProjectsState = {
|
||||
projects: [],
|
||||
error: undefined,
|
||||
alert: undefined,
|
||||
formMode: FormMode.CANCEL,
|
||||
isConfirmDialogLoading: false,
|
||||
isConfirmDialogOpen: false,
|
||||
isFormOpen: false,
|
||||
isLoading: false,
|
||||
projects: [],
|
||||
selectedProjectId: undefined
|
||||
};
|
||||
|
||||
@@ -53,10 +54,10 @@ export const reducer = (
|
||||
projects: action.payload
|
||||
};
|
||||
}
|
||||
case 'SET_ERROR': {
|
||||
case 'SET_ALERT': {
|
||||
return {
|
||||
...state,
|
||||
error: action.payload
|
||||
alert: action.payload
|
||||
};
|
||||
}
|
||||
case 'SET_FORM_MODE': {
|
||||
|
||||
Reference in New Issue
Block a user