#136 solved select projects bug when create new task in Mytask tbl

parent e3590830
......@@ -35,7 +35,6 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{
dateTimeDueFinal = dateTimeDeadLine
dateTimeStartFinal = subtractHours(dateTimeDueFinal, 1)
}
console.log('datTeimeDeadLine ', dateTimeDeadLine)
const newTask = new Task();
newTask.title = title;
......@@ -199,7 +198,6 @@ router.get('/user/:userId', async (req: Request, res: Response):Promise<Response
router.get('/my',auth, async (req: Request, res: Response):Promise<Response>=>{
let projectsRawId =[]
try{
const user = req.body.user
projectsRawId = await dataSource
.getRepository(Project)
......@@ -207,7 +205,6 @@ router.get('/my',auth, async (req: Request, res: Response):Promise<Response>=>{
select:{
id:true
},
where:{
title:Not(Equal("Не определено")),
members:{
......@@ -249,13 +246,10 @@ router.get('/my',auth, async (req: Request, res: Response):Promise<Response>=>{
id:In(projectsList)
}
})
return res.send({tasks, projects})
} catch(e){
return res.status(502).send({message:(e as Error).message})
}
})
......
......@@ -13,15 +13,17 @@ import {
} from "@mui/material";
import { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { AddBox, Luggage } from "@mui/icons-material";
import { AddBox
// , Luggage
} from "@mui/icons-material";
import moment from "moment";
import CustomTableCell from "./CustomTableCell";
import MaterialUIPickers from "./DateTimePicker/DateTimePicker";
import BasicSelect from "../UI/Select/Select";
import { addTask } from "../../store/actions/tasksActions";
import TaskModal from "./TaskModal/TaskModal";
import {dateToISOLikeButLocal} from '../../helpers/CalendarHelpers';
import DateTimePicker from "../Calendars/UI/DateTimePicker/DateTimePicker";
// import {dateToISOLikeButLocal} from '../../helpers/CalendarHelpers';
// import DateTimePicker from "../Calendars/UI/DateTimePicker/DateTimePicker";
export default function NewTaskForm({ projects, setAddTaskForm }) {
console.log('new task form')
......@@ -38,7 +40,7 @@ export default function NewTaskForm({ projects, setAddTaskForm }) {
dateTimeDeadLine: null,
dateTimeTasks: [],
dateTimeDue: null,
project: null,
project: projects?projects.find(project=>project.title==="Личные дела"):null,
accomplish: "opened",
priority: "B",
author: { id: user.id },
......@@ -54,6 +56,8 @@ export default function NewTaskForm({ projects, setAddTaskForm }) {
setModal(true);
};
console.log('task ', task)
const handleClose = () => {
setModal(false);
};
......
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