From 669736b7dec10c7d5309a1d576a02689457226f4 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Mon, 11 Sep 2023 12:57:13 +0800 Subject: [PATCH 1/3] fix add user group --- .../UserGroupSearchForm.js | 60 +++++++++++---- src/pages/pnspsUserGroupSearchPage/index.js | 20 ++--- .../pnspsUserSearchPage/DummyComboRecord.js | 77 ------------------- 3 files changed, 50 insertions(+), 107 deletions(-) delete mode 100644 src/pages/pnspsUserSearchPage/DummyComboRecord.js diff --git a/src/pages/pnspsUserGroupSearchPage/UserGroupSearchForm.js b/src/pages/pnspsUserGroupSearchPage/UserGroupSearchForm.js index 68a4dad..4e399b9 100644 --- a/src/pages/pnspsUserGroupSearchPage/UserGroupSearchForm.js +++ b/src/pages/pnspsUserGroupSearchPage/UserGroupSearchForm.js @@ -7,9 +7,13 @@ import { import MainCard from "../../components/MainCard"; import {useForm} from "react-hook-form"; import * as React from "react"; +import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; +import {useNavigate} from "react-router"; + // ==============================|| DASHBOARD - DEFAULT ||============================== // const UserGroupSearchForm = ({applySearch}) => { + const navigate = useNavigate(); const { reset, register, handleSubmit } = useForm() const onSubmit = (data) => { @@ -20,6 +24,11 @@ const UserGroupSearchForm = ({applySearch}) => { reset(); } + const handleNewGroupClick = (id) => { + // console.log(id) + navigate('/userGroup/'+ id); + }; + return ( { {/*last row*/} - - - + + + + + + + + - - + + + + diff --git a/src/pages/pnspsUserGroupSearchPage/index.js b/src/pages/pnspsUserGroupSearchPage/index.js index dc2209b..c7a9dbd 100644 --- a/src/pages/pnspsUserGroupSearchPage/index.js +++ b/src/pages/pnspsUserGroupSearchPage/index.js @@ -20,14 +20,15 @@ import { lazy } from 'react'; const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); const UserGroupSearchForm = Loadable(lazy(() => import('./UserGroupSearchForm'))); const UserGroupTable = Loadable(lazy(() => import('./UserGroupTable'))); +// import {useNavigate} from "react-router"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const UserGroupSearchPanel = () => { - const [record, setRecord] = useState([]); const [searchCriteria, setSearchCriteria] = useState({}); const [onReady, setOnReady] = useState(false); + // const navigate = useNavigate(); useEffect(() => { getGroupList(); @@ -66,21 +67,12 @@ const UserGroupSearchPanel = () => { : - - - - View User Group + + + + View User Group - {/* - - */} diff --git a/src/pages/pnspsUserSearchPage/DummyComboRecord.js b/src/pages/pnspsUserSearchPage/DummyComboRecord.js deleted file mode 100644 index 356f116..0000000 --- a/src/pages/pnspsUserSearchPage/DummyComboRecord.js +++ /dev/null @@ -1,77 +0,0 @@ -export const eventType = [ - {label: '同心', type: 1}, - {label: '創新', type: 2}, - {label: '惠民', type: 3}, - {label: '傳承', type: 3}, -]; - -export const divisionType = [ - {key: 1, label: 'Railways Branch', type: 1}, - {key: 2, label: 'Electricity and Energy Efficiency Branch ', type: 2}, - {key: 3, label: 'Gas and General Legislation Branch', type: 3}, - {key: 4, label: 'Engineering Services Branch 1', type: 4}, - {key: 5, label: 'Engineering Services Branch 2', type: 5}, - {key: 6, label: 'Engineering Services Branch 3', type: 6}, -]; - -export const subDivision1 = [ - {key: 1, label: 'Sub Division 1 of Railways Branch', type: 1}, - {key: 2, label: 'Sub Division 2 of Railways Branch', type: 2}, - {key: 3, label: 'Sub Division 3 of Railways Branch', type: 3}, - {key: 4, label: 'Sub Division 4 of Railways Branch', type: 4}, -]; - -export const subDivision2 = [ - {key: 1, label: 'Sub Division 1 of Electricity and Energy Efficiency Branch', type: 1}, - {key: 2, label: 'Sub Division 2 of Electricity and Energy Efficiency Branch', type: 2}, - {key: 3, label: 'Sub Division 3 of Electricity and Energy Efficiency Branch', type: 3}, -]; - -export const subDivision3 = [ - {key: 1, label: 'Sub Division 1 of Gas and General Legislation Branch', type: 1}, - {key: 2, label: 'Sub Division 2 of Gas and General Legislation Branch', type: 2}, - {key: 3, label: 'Sub Division 3 of Gas and General Legislation Branch', type: 3}, -]; - -export const subDivision4 = [ - {key: 1, label: 'Sub Division 1 of Engineering Services Branch 1', type: 1}, - {key: 2, label: 'Sub Division 2 of Engineering Services Branch 1', type: 2}, - {key: 3, label: 'Sub Division 3 of Engineering Services Branch 1', type: 3}, - {key: 4, label: 'Sub Division 4 of Engineering Services Branch 1', type: 4}, -]; - -export const subDivision5 = [ - {key: 1, label: 'Sub Division 1 of Engineering Services Branch 2', type: 1}, - {key: 2, label: 'Sub Division 2 of Engineering Services Branch 2', type: 2}, - {key: 3, label: 'Sub Division 3 of Engineering Services Branch 2', type: 3}, -]; - -export const subDivision6 = [ - {key: 1, label: 'Sub Division 1 of Engineering Services Branch 3', type: 1}, - {key: 2, label: 'Sub Division 2 of Engineering Services Branch 3', type: 2}, - {key: 3, label: 'Sub Division 3 of Engineering Services Branch 3', type: 3}, -]; - -export const tableRecord = [ - {trackingNo: 84564564, name: 'Camera', fat: 40, carbs: 2, protein: 4057}, - {trackingNo: 98764564, name: 'Laptop', fat: 300, carbs: 0, protein: 180139}, - {trackingNo: 98756325, name: 'Mobile', fat: 355, carbs: 1, protein: 90989}, - {trackingNo: 98652366, name: 'Handset', fat: 50, carbs: 1, protein: 10239}, - {trackingNo: 13286564, name: 'Computer', fat: 100, carbs: 1, protein: 8334}, - {trackingNo: 86739658, name: 'TV', fat: 99, carbs: 0, protein: 410780}, - {trackingNo: 13256498, name: 'Keyboard', fat: 125, carbs: 2, protein: 70999}, - {trackingNo: 98753263, name: 'Mouse', fat: 89, carbs: 2, protein: 10570}, - {trackingNo: 98753275, name: 'Desktop', fat: 185, carbs: 1, protein: 98063}, - {trackingNo: 98753291, name: 'Chair', fat: 100, carbs: 0, protein: 14001}, -]; - -export const tableRecordTemp = [ - {id:1 ,eventNo: 84564564, eventDate:"2022-03-20" , category: '同心', hrmPlan: 'Visionary Leadership', name: 'HKMA Best Annual Reports Awards - The Electrical and Mechanical Services Department Annual Report 2020/21 - Certificate of Excellence'}, - {id:2 ,eventNo: 98764564, eventDate:"2022-05-12" , category: '同心', hrmPlan: 'Visionary Leadership', name: 'HKMA Best Annual Reports Awards - The Electrical and Mechanical Services Department Annual Report 2020/21- Best New Entry'}, - {id:3 ,eventNo: 98756325, eventDate:"2022-06-04" , category: '創新', hrmPlan: 'Visionary Leadership', name: '19th Hong Kong Occupational Safety and Health Award - Gold Award - The Virtual Reality-based Lift Maintenance training programme'}, - {id:4 ,eventNo: 98652366, eventDate:"2022-08-16" , category: '創新', hrmPlan: 'Visionary Leadership', name: 'BIM Achievement 2022 - BIM Organisations 2022'}, - {id:5 ,eventNo: 13286564, eventDate:"2022-09-30" , category: '惠民', hrmPlan: 'Visionary Leadership', name: 'Civil Service Outstanding Service Award Scheme 2022 - Excellence in Team Collaboration (Internal Service) - Innovation Facilitator'}, - {id:6 ,eventNo: 86739658, eventDate:"2022-10-25" , category: '惠民', hrmPlan: 'Visionary Leadership', name: 'Civil Service Outstanding Service Award Scheme 2022 - Excellence in Team Collaboration (Management of Crisis) - E&M 100 - CHT Rescue Team'}, - {id:7 ,eventNo: 13256498, eventDate:"2022-11-21" , category: '傳承', hrmPlan: 'Visionary Leadership', name: '11th Guangzhou/Hong Kong/Macao/Chengdu Youth Skills Competition - Three TTs from the EMSD got the top three prizes in the Electrical Installations trade of the Hong Kong Region qualifying competition'}, - {id:8 ,eventNo: 98753263, eventDate:"2022-12-31" , category: '傳承', hrmPlan: 'Visionary Leadership', name: 'VTC 2021 Outstanding Apprentices Scheme - Outstanding Apprentice - Mr. LEE King (TTII)'}, -]; \ No newline at end of file From dcdbc542eef8eee461540ef7b70a025330fc9005 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Mon, 11 Sep 2023 13:50:09 +0800 Subject: [PATCH 2/3] update new gld use by admin --- .../pnspsUserDetailPage/UserGroupCard.js | 4 +- .../pnspsUserDetailPage/UserGroupTable.js | 5 +- .../UserInformationCard.js | 73 +++++++++-------- src/pages/pnspsUserDetailPage/index.js | 75 +++++++++++------ .../pnspsUserSearchPage/UserSearchForm.js | 81 ++++++++++--------- src/pages/pnspsUserSearchPage/index.js | 23 +++--- 6 files changed, 153 insertions(+), 108 deletions(-) diff --git a/src/pages/pnspsUserDetailPage/UserGroupCard.js b/src/pages/pnspsUserDetailPage/UserGroupCard.js index 063d4af..00f2a0e 100644 --- a/src/pages/pnspsUserDetailPage/UserGroupCard.js +++ b/src/pages/pnspsUserDetailPage/UserGroupCard.js @@ -15,7 +15,7 @@ const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingCompo // ==============================|| DASHBOARD - DEFAULT ||============================== // -const UserGroupCard = ({isCollectData, updateUserGroupList,userData}) => { +const UserGroupCard = ({isCollectData, updateUserGroupList,userData,isNewRecord}) => { const [currentUserData, setCurrentUserData] = React.useState({}); const [onReady, setOnReady] = useState(false); const [selectedRow, setSelectedRow] = useState([]); @@ -30,7 +30,6 @@ const UserGroupCard = ({isCollectData, updateUserGroupList,userData}) => { useEffect(() => { //if state data are ready and assign to different field - // if (Object.keys(userData).length > 0 &¤tUserData !== undefined) { if (Object.keys(userData).length > 0 &¤tUserData !== undefined) { setOnReady(true); } @@ -56,6 +55,7 @@ const UserGroupCard = ({isCollectData, updateUserGroupList,userData}) => { ); diff --git a/src/pages/pnspsUserDetailPage/UserGroupTable.js b/src/pages/pnspsUserDetailPage/UserGroupTable.js index 4e24bc1..871ff2e 100644 --- a/src/pages/pnspsUserDetailPage/UserGroupTable.js +++ b/src/pages/pnspsUserDetailPage/UserGroupTable.js @@ -13,7 +13,7 @@ const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingCompo // ==============================|| EVENT TABLE ||============================== // -export default function UserGroupTable({setSelectedRow, userGroup}) { +export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord}) { const [groupData, setGroupData] = useState([]); const [onReady, setOnReady] = useState(false); const [currentSelectedRow, setCurrentSelectedRow] = useState(userGroup); @@ -33,8 +33,7 @@ export default function UserGroupTable({setSelectedRow, userGroup}) { useEffect(() => { //if state data are ready and assign to different field - console.log(groupData) - if (groupData!== undefined) { + if (groupData.length > 0||isNewRecord) { setOnReady(true); } }, [groupData]); diff --git a/src/pages/pnspsUserDetailPage/UserInformationCard.js b/src/pages/pnspsUserDetailPage/UserInformationCard.js index 01baee3..72e0dc0 100644 --- a/src/pages/pnspsUserDetailPage/UserInformationCard.js +++ b/src/pages/pnspsUserDetailPage/UserInformationCard.js @@ -1,7 +1,10 @@ // material-ui import { - FormControl, IconButton, - Grid, InputAdornment, Typography, FormLabel, + FormControl, + IconButton, + Grid, + InputAdornment, + Typography, FormLabel, OutlinedInput, } from '@mui/material'; import MainCard from "../../components/MainCard"; @@ -96,40 +99,42 @@ const UserInformationCard = ({isCollectData, updateUserObject,userData,isNewReco + { + isNewRecord? + + + + Password: + - - - - Password: + + + + + {showPassword ? : } + + + } + /> + + - - - - - - {showPassword ? : } - - - } - /> - - - - + : null + } diff --git a/src/pages/pnspsUserDetailPage/index.js b/src/pages/pnspsUserDetailPage/index.js index 032cf51..fc14732 100644 --- a/src/pages/pnspsUserDetailPage/index.js +++ b/src/pages/pnspsUserDetailPage/index.js @@ -9,7 +9,7 @@ import {useEffect, useState} from "react"; import * as React from "react"; import axios from "axios"; import {useNavigate,useParams} from "react-router-dom"; -import {GLD_USER_PATH,DELETE_USER} from "../../utils/ApiPathConst"; +import {GLD_USER_PATH,DELETE_USER,POST_ADMIN_USER_REGISTER} from "../../utils/ApiPathConst"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; @@ -130,29 +130,58 @@ const UserMaintainPage = () => { if(userConfirm && onReady){ const deletedUserAuth = getDeletedRecordWithRefList(refUserData.authIds,userAuthData); const deletedUserGroup = getDeletedRecordWithRefList(refUserData.groupIds,userGroupData); - axios.post(`${GLD_USER_PATH}/${params.id}`, - { - "enName": editedCustomerData.enName, - "locked": editedCustomerData.locked, - // "password": editedCustomerData.password, - // "phone": editedCustomerData.phone, - "post": editedCustomerData.post, - "emailAddress": editedCustomerData.emailAddress, - "addGroupIds": userGroupData, - "removeGroupIds": deletedUserGroup, - "addAuthIds": userAuthData, - "removeAuthIds": deletedUserAuth, - }, - ).then((response) => { - if (response.status === 204) { - // notifySaveSuccess(); - navigate('/userSearchview'); - } - }) - .catch(error => { - console.log(error); - return false; + // console.log(userGroupData) + // console.log(userAuthData) + if( parseInt(params.id) >= -1){ + axios.post(`${GLD_USER_PATH}/${params.id}`, + { + "enName": editedCustomerData.enName, + "locked": editedCustomerData.locked, + // "password": editedCustomerData.password, + // "phone": editedCustomerData.phone, + "post": editedCustomerData.post, + "emailAddress": editedCustomerData.emailAddress, + "addGroupIds": userGroupData, + "removeGroupIds": deletedUserGroup, + "addAuthIds": userAuthData, + "removeAuthIds": deletedUserAuth, + }, + ).then((response) => { + if (response.status === 204) { + // notifySaveSuccess(); + navigate('/userSearchview'); + } + }) + .catch(error => { + console.log(error); + return false; + }); + }else{ + axios.post(POST_ADMIN_USER_REGISTER, + { + "username": editedCustomerData.username, + "name": editedCustomerData.username, + "password": editedCustomerData.password, + "enName": editedCustomerData.enName, + "locked": editedCustomerData.locked, + "emailAddress": editedCustomerData.emailAddress, + "post": editedCustomerData.post, + "addGroupIds": userGroupData, + "removeGroupIds": [], + "addAuthIds": userAuthData, + "removeAuthIds": [], + }, + ).then((response) => { + if (response.status === 200) { + // notifySaveSuccess(); + navigate('/userSearchview'); + } + }) + .catch(error => { + console.log(error); + return false; }); + } } setUserConfirm(false); }, [editedCustomerData,userGroupData,userAuthData]); diff --git a/src/pages/pnspsUserSearchPage/UserSearchForm.js b/src/pages/pnspsUserSearchPage/UserSearchForm.js index e2fc547..47dc8ca 100644 --- a/src/pages/pnspsUserSearchPage/UserSearchForm.js +++ b/src/pages/pnspsUserSearchPage/UserSearchForm.js @@ -14,11 +14,14 @@ import { import Checkbox from "@mui/material/Checkbox"; import * as React from "react"; -// import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; +import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; +import {useNavigate} from "react-router"; + // ==============================|| DASHBOARD - DEFAULT ||============================== // const UserSearchForm = ({applySearch}) => { + const navigate = useNavigate(); const [type, setType] = useState([]); const [locked, setLocked] = useState(false); @@ -51,9 +54,10 @@ const UserSearchForm = ({applySearch}) => { reset(); } - // const handleNewUserClick = (id) => () => { - // navigate('/user/'+ id); - // }; + const handleNewUserClick = (id) => { + // console.log(id) + navigate('/user/'+ id); + }; return ( { {/*last row*/} - - - - - - - - - {/* - - - */} - {/* + + + - */} + + + + + + + + + + + + diff --git a/src/pages/pnspsUserSearchPage/index.js b/src/pages/pnspsUserSearchPage/index.js index 73104fe..9b1d127 100644 --- a/src/pages/pnspsUserSearchPage/index.js +++ b/src/pages/pnspsUserSearchPage/index.js @@ -1,6 +1,9 @@ // material-ui import { - Grid, Typography + Grid, + Typography, + Stack, + // Button } from '@mui/material'; import MainCard from "../../components/MainCard"; import {useEffect, useState} from "react"; @@ -8,9 +11,6 @@ import axios from "axios"; import {GLD_USER_PATH} from "../../utils/ApiPathConst"; import * as React from "react"; -// import LoadingComponent from "../extra-pages/LoadingComponent"; -// import SearchForm from "./UserSearchForm"; -// import EventTable from "./UserTable"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); @@ -20,7 +20,6 @@ const EventTable = Loadable(lazy(() => import('./UserTable'))); // ==============================|| DASHBOARD - DEFAULT ||============================== // const UserSettingPage = () => { - const [record,setRecord] = useState([]); const [searchCriteria, setSearchCriteria] = useState({}); const [onReady, setOnReady] = useState(false); @@ -61,10 +60,16 @@ const UserSettingPage = () => { !onReady ? : - - - View User - + + + + + + View User + + + + {/*row 1*/} From a24dd37d8c31a85efb30e10dc9dc8d07eceb220e Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Mon, 11 Sep 2023 14:11:11 +0800 Subject: [PATCH 3/3] add gld user combo and fix user grid reload bug --- src/pages/pnspsUserDetailPage/UserAuthTable.js | 4 ++-- src/pages/pnspsUserDetailPage/UserAuthorityCard.js | 3 ++- src/pages/pnspsUserGroupDetailPage/GroupAuthCard.js | 3 ++- src/pages/pnspsUserGroupDetailPage/GroupAuthTable.js | 4 ++-- src/pages/pnspsUserGroupDetailPage/UserAddCard.js | 4 ++-- src/utils/ApiPathConst.js | 1 + 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/pages/pnspsUserDetailPage/UserAuthTable.js b/src/pages/pnspsUserDetailPage/UserAuthTable.js index 8a92d15..af03ded 100644 --- a/src/pages/pnspsUserDetailPage/UserAuthTable.js +++ b/src/pages/pnspsUserDetailPage/UserAuthTable.js @@ -15,7 +15,7 @@ const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingCompo // ==============================|| EVENT TABLE ||============================== // -export default function UserAuthTable({setSelectedRow, userAuth}) { +export default function UserAuthTable({setSelectedRow, userAuth,isNewRecord}) { const [authData, setAuthData] = useState([]); const [onReady, setOnReady] = useState(false); const [currentSelectedRow, setCurrentSelectedRow] = useState(userAuth); @@ -35,7 +35,7 @@ export default function UserAuthTable({setSelectedRow, userAuth}) { useEffect(() => { //if state data are ready and assign to different field - if (authData.length > 0) { + if (authData.length > 0||isNewRecord) { setOnReady(true); } }, [authData]); diff --git a/src/pages/pnspsUserDetailPage/UserAuthorityCard.js b/src/pages/pnspsUserDetailPage/UserAuthorityCard.js index 1f4c76b..8949ef3 100644 --- a/src/pages/pnspsUserDetailPage/UserAuthorityCard.js +++ b/src/pages/pnspsUserDetailPage/UserAuthorityCard.js @@ -16,7 +16,7 @@ const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingCompo // ==============================|| DASHBOARD - DEFAULT ||============================== // -const UserAuthorityCard = ({isCollectData, updateUserAuthList,userData}) => { +const UserAuthorityCard = ({isCollectData, updateUserAuthList,userData,isNewRecord}) => { const [currentAuthData, setCurrentAuthData] = React.useState({}); const [onReady, setOnReady] = useState(false); const [selectedRow, setSelectedRow] = useState([]); @@ -57,6 +57,7 @@ const UserAuthorityCard = ({isCollectData, updateUserAuthList,userData}) => { ); diff --git a/src/pages/pnspsUserGroupDetailPage/GroupAuthCard.js b/src/pages/pnspsUserGroupDetailPage/GroupAuthCard.js index 4e94f55..e223b0b 100644 --- a/src/pages/pnspsUserGroupDetailPage/GroupAuthCard.js +++ b/src/pages/pnspsUserGroupDetailPage/GroupAuthCard.js @@ -15,7 +15,7 @@ const GroupAuthTable = Loadable(lazy(() => import('./GroupAuthTable'))); // ==============================|| DASHBOARD - DEFAULT ||============================== // -const GroupAuthCard = ({isCollectData, updateUserAuthList,userGroupData}) => { +const GroupAuthCard = ({isCollectData, updateUserAuthList,userGroupData,isNewRecord}) => { const [currentAuthData, setCurrentAuthData] = React.useState({}); const [onReady, setOnReady] = useState(false); const [selectedRow, setSelectedRow] = useState([]); @@ -62,6 +62,7 @@ const GroupAuthCard = ({isCollectData, updateUserAuthList,userGroupData}) => { ); diff --git a/src/pages/pnspsUserGroupDetailPage/GroupAuthTable.js b/src/pages/pnspsUserGroupDetailPage/GroupAuthTable.js index 93c13c0..f4649e6 100644 --- a/src/pages/pnspsUserGroupDetailPage/GroupAuthTable.js +++ b/src/pages/pnspsUserGroupDetailPage/GroupAuthTable.js @@ -15,7 +15,7 @@ const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingCompo // ==============================|| EVENT TABLE ||============================== // -export default function GroupAuthTable({setSelectedRow, userAuth}) { +export default function GroupAuthTable({setSelectedRow, userAuth,isNewRecord}) { const [authData, setAuthData] = useState([]); const [onReady, setOnReady] = useState(false); const [currentSelectedRow, setCurrentSelectedRow] = useState(userAuth); @@ -35,7 +35,7 @@ export default function GroupAuthTable({setSelectedRow, userAuth}) { useEffect(() => { //if state data are ready and assign to different field - if (authData.length > 0) { + if (authData.length > 0||isNewRecord) { setOnReady(true); } }, [authData]); diff --git a/src/pages/pnspsUserGroupDetailPage/UserAddCard.js b/src/pages/pnspsUserGroupDetailPage/UserAddCard.js index de144dc..78a4c1e 100644 --- a/src/pages/pnspsUserGroupDetailPage/UserAddCard.js +++ b/src/pages/pnspsUserGroupDetailPage/UserAddCard.js @@ -7,7 +7,7 @@ import { import MainCard from "../../components/MainCard"; import * as React from "react"; import {useEffect, useState} from "react"; -import {GET_GROUP_MEMBER_LIST_PATH, GET_USER_COMBO_LIST} from "../../utils/ApiPathConst"; +import {GET_GROUP_MEMBER_LIST_PATH, GET_USER_GLD_COMBO_LIST} from "../../utils/ApiPathConst"; import axios from "axios"; import {apiPath} from "../../auth/utils"; import Autocomplete from "@mui/material/Autocomplete"; @@ -43,7 +43,7 @@ const UserAddCard = ({isCollectData, updateGroupMember,userGroupData,isNewRecord } useEffect(() => { - axios.get(`${apiPath}${GET_USER_COMBO_LIST}`) + axios.get(`${apiPath}${GET_USER_GLD_COMBO_LIST}`) .then((response) => { if (response.status === 200) { setUserComboList(response.data.records); diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index aaffdb7..bcee5ac 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -11,6 +11,7 @@ export const GET_GROUP_AUTH_LIST = '/group/auth/combo'; export const GLD_USER_PATH = apiPath+'/user/gld'; export const GET_AUTH_LIST = '/user/auth/combo'; export const GET_USER_COMBO_LIST = '/user/combo'; +export const GET_USER_GLD_COMBO_LIST = '/user/combo/gld'; export const GET_USER_LOCK = apiPath+'/user/lock'; export const GET_USER_UNLOCK = apiPath+'/user/unlock';