29 lines
640 B
TypeScript

import { createReducer, on } from '@ngrx/store';
import { initialState } from './state';
import { authSuccess, deptSuccess, deptUserSuccess } from './actions';
export const reducer = createReducer(
initialState,
on(authSuccess, (state, action) => {
return {
...state,
auth: action.res
};
}),
on(deptSuccess, (state, action) => {
return {
...state,
departmentInfoList: action.departmentInfoList
};
}),
on(deptUserSuccess, (state, action) => {
return {
...state,
selectedDepartmentUserInfoList: action.userInfos,
selectedDepartmentStatus: action.res
};
})
);