Commit 9e60add3 authored by Ermolaev Timur's avatar Ermolaev Timur

#149 Пофиксил баги

parent 29c6594e
......@@ -319,7 +319,7 @@ router.put('/:taskId',auth,authAuthorOrExecutorOfTask,async(req:Request, res:Res
dateTimeDue,executor,accomplish,dateTimeDeadLine, dateTimeFactDeadLine,priority} = req.body;
const task = await taskFinderById(taskId)
if (!task) return res.status(404).send({Message:'task not found'})
console.log(req.body)
console.log ('dateTimeDeadLine ', dateTimeDeadLine,'authorStatus '
,authorStatus,'executorStatus ',executorStatus)
......
......@@ -2,7 +2,6 @@ import { FormControl, InputLabel, MenuItem, Select } from '@mui/material';
import { memo } from 'react';
function СustomSelect({ value, onChange, label, variant = 'standard', items, id, defaultValue, name, sx}) {
console.log(value)
return (
<>
<FormControl variant={variant} sx={ sx?.width ? sx : { m: 0, minWidth: 125}}>
......
......@@ -19,7 +19,7 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
if (currentTask?.project) {
currentTask.project = allUserProjectsForModalTask.find((project) => project?.value?.id === currentTask?.project?.id)?.value
const arrUsers = currentTask?.project?.members.map((member) => { return { value: member.user, text: member.user.displayName } })
arrUsers.push({ value: null, text: 'Никто' })
arrUsers.push({ value: '', text: 'Никто' })
return arrUsers
} else {
return [{ value: '', text: 'Выберите проект' }]
......
......@@ -10,7 +10,6 @@ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
import TableForCopiesTasks from "./TableForCopiesTasks/TableForCopiesTasks";
import EditRow from "./EditRow/EditRow";
import { accomplishStatuses } from "../../../../../constants";
const editClass = {
cursor: 'pointer',
......
......@@ -16,7 +16,6 @@ function descendingComparator(a, b, orderBy, order) {
}
export function getComparator(order, orderBy) {
console.log(order)
return order === 'desc'
? (a, b) => descendingComparator(a, b, orderBy)
: (a, b) => -descendingComparator(a, b, orderBy, order);
......
......@@ -115,12 +115,13 @@ export default function EnhancedTable() {
}, [addFormStatus])
const createNewTaskHandler = useCallback(() => {
if (newTask.priority === '' || newTask.project === '' || newTask.executor) {
if (newTask.priority === '' || newTask.project === '' || newTask.executor === '') {
const task = {
...newTask,
priority: newTask.priority ? newTask.priority : null,
project: newTask.project ? newTask.project : null,
executor: newTask.executor ? newTask.executor : null,
dateTimeDeadLine: new Date(newTask.dateTimeDeadLine) instanceof Date && !isNaN(new Date(newTask.dateTimeDeadLine)) ? newTask.dateTimeDeadLine : null
}
dispatch(addTaskToUserTasksTable(task))
} else {
......@@ -151,12 +152,13 @@ export default function EnhancedTable() {
}
const editCurrentTaskHandler = useCallback(() => {
if (currentTask.priority === '' || currentTask.project === '' || currentTask.executor) {
if (currentTask.priority === '' || currentTask.project === '' || currentTask.executor === '' || !Object.keys(currentTask.executor).length) {
const task = {
...currentTask,
priority: currentTask.priority ? currentTask.priority : null,
project: currentTask.project ? currentTask.project : null,
executor: currentTask.executor ? currentTask.executor : null,
executor: currentTask.executor && currentTask.executor?.id ? currentTask.executor : null,
dateTimeDeadLine: new Date(currentTask.dateTimeDeadLine) instanceof Date && !isNaN(new Date(currentTask.dateTimeDeadLine)) ? currentTask.dateTimeDeadLine : null
}
dispatch(editTaskUsers(task))
} else {
......
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