diff --git a/src/features/workspace-view/workspace-card/index.tsx b/src/features/workspace-view/workspace-card/index.tsx
index 567545d..b6770e2 100644
--- a/src/features/workspace-view/workspace-card/index.tsx
+++ b/src/features/workspace-view/workspace-card/index.tsx
@@ -118,19 +118,21 @@ const WorkspaceCard = (props: workspaceCardProps) => {
const HandleArchive = async () => {
if (!workspaceName.endsWith('-userspace') && token) {
const initArc = archeive;
+
const func = async () => {
- let status: { [key: string]: boolean } = {
- [workspaceName]: !bookmark,
+ const status: { [key: string]: boolean } = {
+ [workspaceName]: (!archeive),
};
-
- const res = await setOrgArcheiveStatus(token, status);
+ console.log(status)
+ const res = await setOrgArcheiveStatus(token, status);
+ console.log(res)
const orgs = userContext?.userOrgs;
if (orgs?.userOrgs.hasOwnProperty(workspaceName)) {
- orgs.userOrgs[workspaceName].archive = (!bookmark).toString();
+ orgs.userOrgs[workspaceName].archive = (!archeive).toString();
userContext?.setUserOrgs(orgs);
}
};
- if (initArc) {
+ if (!initArc) {
toast.promise(func(), {
loading: 'Archiving',
success: Successfully archived,
@@ -147,7 +149,7 @@ const WorkspaceCard = (props: workspaceCardProps) => {
};
useEffect(() => {
workSpaceData();
- }, [workspaceName, userContext?.setUserOrgs, HandleArchive, HandleDelete, HandlePin]);
+ }, [ userContext?.setUserOrgs ]);
return (
diff --git a/src/features/workspace/components/projectCard/index.tsx b/src/features/workspace/components/projectCard/index.tsx
index 72666d5..5b8528d 100644
--- a/src/features/workspace/components/projectCard/index.tsx
+++ b/src/features/workspace/components/projectCard/index.tsx
@@ -131,7 +131,7 @@ const ProjectCard: React.FC = ({
useEffect(()=>{
fetchProjectData()
fetchProjectMembers()
- },[ PinHandler, ArchiveHandler, DeleteHandler,userContext?.setUserOrgs, userContext?.setUserOrgs])
+ },[ userContext?.setUsername, userContext?.setUserOrgs])
return (