mirror of
https://github.com/plankanban/planka.git
synced 2025-07-27 09:09:46 +02:00
Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
parent
d6cb1f6683
commit
b39119ace4
478 changed files with 21226 additions and 19495 deletions
39
client/src/reducers/ui/authenticate-form.js
Normal file
39
client/src/reducers/ui/authenticate-form.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
import ActionTypes from '../../constants/ActionTypes';
|
||||
|
||||
const initialState = {
|
||||
data: {
|
||||
emailOrUsername: '',
|
||||
password: '',
|
||||
},
|
||||
isSubmitting: false,
|
||||
error: null,
|
||||
};
|
||||
|
||||
export default (state = initialState, { type, payload }) => {
|
||||
switch (type) {
|
||||
case ActionTypes.AUTHENTICATE:
|
||||
return {
|
||||
...state,
|
||||
data: {
|
||||
...state.data,
|
||||
...payload.data,
|
||||
},
|
||||
isSubmitting: true,
|
||||
};
|
||||
case ActionTypes.AUTHENTICATE__SUCCESS:
|
||||
return initialState;
|
||||
case ActionTypes.AUTHENTICATE__FAILURE:
|
||||
return {
|
||||
...state,
|
||||
isSubmitting: false,
|
||||
error: payload.error,
|
||||
};
|
||||
case ActionTypes.AUTHENTICATE_ERROR_CLEAR:
|
||||
return {
|
||||
...state,
|
||||
error: null,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue