added projectrepository and toast that was missing.
This commit is contained in:
parent
61b41c3aa4
commit
4e1891efdb
@ -5,6 +5,8 @@ import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
||||
import { MANAGE_PROJECT } from "../../utils/constants";
|
||||
import { cacheData, getCachedData } from "../../slices/apiDataManager";
|
||||
import ManageProjectInfo from "./ManageProjectInfo";
|
||||
import ProjectRepository from "../../repositories/ProjectRepository";
|
||||
import showToast from "../../services/toastService";
|
||||
|
||||
const AboutProject = ({ data }) => {
|
||||
const [CurrentProject, setCurrentProject] = useState(data);
|
||||
@ -19,7 +21,9 @@ const AboutProject = ({ data }) => {
|
||||
const handleShow = () => setShowModal(true);
|
||||
const handleClose = () => setShowModal(false);
|
||||
const handleFormSubmit = (updatedProject, setLoading) => {
|
||||
if (CurrentProject?.id) {
|
||||
if ( CurrentProject?.id )
|
||||
{
|
||||
|
||||
ProjectRepository.updateProject(CurrentProject.id, updatedProject)
|
||||
.then((response) => {
|
||||
const updatedProjectData = {
|
||||
@ -45,7 +49,7 @@ const AboutProject = ({ data }) => {
|
||||
cacheData("projectslist", updatedProjectsList);
|
||||
}
|
||||
|
||||
showToast("Project updated successfully.", "success");
|
||||
showToast( "Project updated successfully.", "success" );
|
||||
setLoading(false);
|
||||
setShowModal(false);
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user