#167 added fetchprojects non watcher function to the UsersTasks container

parent 632e753c
......@@ -67,7 +67,7 @@ router.post('/',auth, async (req:Request, res:Response): Promise<Response> => {
where:{
title:titleTrimed
}})
if(projectCheck.length>0) {return res.status(400).send({message:"suchc Project already exists"})}
if(projectCheck.length>0) {return res.status(400).send({message:"such Project already exists"})}
const member:Member = new Member;
member.user= user;
member.roleProject= MemberRole.ADMIN;
......
......@@ -119,7 +119,6 @@ export default function MyTasks() {
}
dispatch(fetchProjectsNonWatcherForTaskCreate(user.id))
setAddFormStatus((prevState) => { return !prevState })
// }, [addFormStatus])
}, [])
......
......@@ -5,7 +5,7 @@ import UsersTasksTableContainer from '../../components/UsersTasksCompoments/User
import { activateCreateCopyTasksMode, addTaskToUserTasksTable, deleteDateTimeTaskUsers, deleteTaskUsers, editTaskUsers, fetchAllTasksByMembership, sortTaskByProjects } from '../../store/actions/tasksActions';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { useCallback, useEffect, useState } from 'react';
import { fetchAllUserProjects, fetchProjects } from '../../store/actions/projectsActions';
import { fetchAllUserProjects, fetchProjects, fetchProjectsNonWatcherForTaskCreate } from '../../store/actions/projectsActions';
import moment from 'moment';
import { useNavigate } from 'react-router-dom';
......@@ -125,8 +125,9 @@ export default function UsersTasks() {
dateTimeDeadLine: null
})
}
dispatch(fetchProjectsNonWatcherForTaskCreate(user.id))
setAddFormStatus((prevState) => { return !prevState })
}, [addFormStatus])
}, [])
const createNewTaskHandler = useCallback(() => {
if (newTask.priority === '' || newTask.project === '' || newTask.executor === '') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment