diff --git a/src/containers/basis/group/BasisGroupUsersContainer.js b/src/containers/basis/group/BasisGroupUsersContainer.js index c9e63e9..985816f 100644 --- a/src/containers/basis/group/BasisGroupUsersContainer.js +++ b/src/containers/basis/group/BasisGroupUsersContainer.js @@ -1,6 +1,5 @@ import { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { useHistory } from 'react-router-dom'; import { Button, Row, Col } from 'reactstrap'; import { BasisGroupGrid } from '../../../components/basis/group/BasisGroupGrid'; import { BasisGroupUsersGrid } from '../../../components/basis/group/BasisGroupUsersGrid'; @@ -12,8 +11,15 @@ import * as Actions from '../../../modules/basis/group/actions/basisGroupAction' export const BasisGroupUsersContainer = props => { const dispatch = useDispatch(); - const { joinList, joinListCount, selectData, userList, userCount } = - useSelector(state => state.groupState); + const { + joinList, + joinListCount, + userList, + userCount, + groupList, + groupListCount, + selectData + } = useSelector(state => state.groupState); const { user } = useSelector(state => state.authState); const [params, setParams] = useState({ @@ -45,7 +51,7 @@ export const BasisGroupUsersContainer = props => { const columns = [ { name: '그룹명', - selector: row => row.groupNm , + selector: row => row.groupNm, minWidth: '102px', sortable: true, cell: row => { @@ -348,11 +354,25 @@ export const BasisGroupUsersContainer = props => { useEffect(() => { if (user?.cstmrSno) { - dispatch(Actions.JOIN_LIST.request({ cstmrSno: user?.cstmrSno })); setParams({ ...params, cstmrSno: user?.cstmrSno }); + if (user.authId === 'SUPER' || user.authId === 'ADMIN') { + dispatch(Actions.GROUP_LIST.request(user.cstmrSno)); + } else { + dispatch( + Actions.JOIN_LIST.request({ + cstmrSno: user.cstmrSno, + groupId: selectData?.groupId + }) + ); + } + // dispatch(Actions.JOIN_LIST.request({ cstmrSno: user?.cstmrSno })); + // setParams({ + // ...params, + // cstmrSno: user?.cstmrSno + // }); } }, [user]); @@ -465,30 +485,26 @@ export const BasisGroupUsersContainer = props => { return ( - {/* - */}
- + {user ? ( + <> + + + ) : ( + <> + )} {selectData ? (