intranet add new and edit APIs

This commit is contained in:
Sonika 2023-12-22 16:24:19 +05:30
parent 21a7c0b778
commit 866efea933
3 changed files with 20 additions and 2 deletions

View 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;
};

View 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;
};

View File

@ -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])