intranet add new and edit APIs
This commit is contained in:
parent
21a7c0b778
commit
866efea933
9
src/APIs/IntranetUsersAPIs/postAddUser.tsx
Normal file
9
src/APIs/IntranetUsersAPIs/postAddUser.tsx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
export const postNewIntranetUsersData = async (data: any)=> {
|
||||||
|
const { data: response } = await axios.post(
|
||||||
|
`${process.env.REACT_APP_API_URL}/add-intranet-user`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
return await response.data;
|
||||||
|
};
|
||||||
9
src/APIs/IntranetUsersAPIs/postEditUser.tsx
Normal file
9
src/APIs/IntranetUsersAPIs/postEditUser.tsx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
export const postEditIntranetUsersData = async (data: any)=> {
|
||||||
|
const { data: response } = await axios.post(
|
||||||
|
`${process.env.REACT_APP_API_URL}/edit-intranet-user`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
return await response.data;
|
||||||
|
};
|
||||||
@ -21,7 +21,7 @@ import {
|
|||||||
import DeleteIcon from '@mui/icons-material/Delete';
|
import DeleteIcon from '@mui/icons-material/Delete';
|
||||||
import EditIcon from '@mui/icons-material/Edit';
|
import EditIcon from '@mui/icons-material/Edit';
|
||||||
import AddIcon from '@mui/icons-material/Add';
|
import AddIcon from '@mui/icons-material/Add';
|
||||||
import { postNewManageUsersData } from "../../APIs/ManageUsersAPIs/postAddUser";
|
import { postNewIntranetUsersData } from "../../APIs/IntranetUsersAPIs/postAddUser";
|
||||||
|
|
||||||
|
|
||||||
const StyledTextField = (props:any) => (
|
const StyledTextField = (props:any) => (
|
||||||
@ -69,7 +69,7 @@ export default function IntranetUsers(){
|
|||||||
},[open])
|
},[open])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedRow){
|
if (selectedRow){
|
||||||
postNewManageUsersData(selectedRow);
|
postNewIntranetUsersData(selectedRow);
|
||||||
}
|
}
|
||||||
},[data])
|
},[data])
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user