added projectrepository and toast that was missing.

This commit is contained in:
Pramod Mahajan 2025-07-08 09:53:08 +05:30
parent 61b41c3aa4
commit 4e1891efdb

View File

@ -5,6 +5,8 @@ import { useHasUserPermission } from "../../hooks/useHasUserPermission";
import { MANAGE_PROJECT } from "../../utils/constants"; import { MANAGE_PROJECT } from "../../utils/constants";
import { cacheData, getCachedData } from "../../slices/apiDataManager"; import { cacheData, getCachedData } from "../../slices/apiDataManager";
import ManageProjectInfo from "./ManageProjectInfo"; import ManageProjectInfo from "./ManageProjectInfo";
import ProjectRepository from "../../repositories/ProjectRepository";
import showToast from "../../services/toastService";
const AboutProject = ({ data }) => { const AboutProject = ({ data }) => {
const [CurrentProject, setCurrentProject] = useState(data); const [CurrentProject, setCurrentProject] = useState(data);
@ -19,7 +21,9 @@ const AboutProject = ({ data }) => {
const handleShow = () => setShowModal(true); const handleShow = () => setShowModal(true);
const handleClose = () => setShowModal(false); const handleClose = () => setShowModal(false);
const handleFormSubmit = (updatedProject, setLoading) => { const handleFormSubmit = (updatedProject, setLoading) => {
if (CurrentProject?.id) { if ( CurrentProject?.id )
{
ProjectRepository.updateProject(CurrentProject.id, updatedProject) ProjectRepository.updateProject(CurrentProject.id, updatedProject)
.then((response) => { .then((response) => {
const updatedProjectData = { const updatedProjectData = {
@ -45,7 +49,7 @@ const AboutProject = ({ data }) => {
cacheData("projectslist", updatedProjectsList); cacheData("projectslist", updatedProjectsList);
} }
showToast("Project updated successfully.", "success"); showToast( "Project updated successfully.", "success" );
setLoading(false); setLoading(false);
setShowModal(false); setShowModal(false);
}) })