Files
astuto/app/javascript/reducers/SiteSettings/generalReducer.ts
Riccardo Graziosi 4c73b398e8 Add OAuth2 authentication (#147)
- Added Site settings > Authentication section
- Create/edit/delete your custom oauth2 configurations
- Login or signup with oauth2
2022-08-05 18:15:17 +02:00

49 lines
901 B
TypeScript

import {
TenantUpdateActionTypes,
TENANT_UPDATE_START,
TENANT_UPDATE_SUCCESS,
TENANT_UPDATE_FAILURE,
} from '../../actions/Tenant/updateTenant';
export interface SiteSettingsGeneralState {
areUpdating: boolean;
error: string;
}
const initialState: SiteSettingsGeneralState = {
areUpdating: false,
error: '',
};
const siteSettingsGeneralReducer = (
state = initialState,
action:
TenantUpdateActionTypes
) => {
switch (action.type) {
case TENANT_UPDATE_START:
return {
...state,
areUpdating: true,
};
case TENANT_UPDATE_SUCCESS:
return {
...state,
areUpdating: false,
error: '',
};
case TENANT_UPDATE_FAILURE:
return {
...state,
areUpdating: false,
error: action.error,
};
default:
return state;
}
}
export default siteSettingsGeneralReducer;