diff --git a/src/views/SimproV2/CreatedProyek/AsignHrProject.js b/src/views/SimproV2/CreatedProyek/AsignHrProject.js index 9812fa4..315ef1b 100644 --- a/src/views/SimproV2/CreatedProyek/AsignHrProject.js +++ b/src/views/SimproV2/CreatedProyek/AsignHrProject.js @@ -120,6 +120,7 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, compan }, "columns": [ { "name": "created_by", "logic_operator": "ilike", "value": "" }, + { "name": "company_id", "logic_operator": "=", "value": company_id }, ], "joins": [], "orders": { diff --git a/src/views/SimproV2/CreatedProyek/DialogFormGantt.js b/src/views/SimproV2/CreatedProyek/DialogFormGantt.js index 96e00a1..ab236ca 100644 --- a/src/views/SimproV2/CreatedProyek/DialogFormGantt.js +++ b/src/views/SimproV2/CreatedProyek/DialogFormGantt.js @@ -2,11 +2,11 @@ import React, { useEffect, useState } from 'react' import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { Button, Form, FormGroup, Label, Input, Col, Row } from 'reactstrap'; import axios from "../../../const/interceptorApi"; -import { VERSION_GANTT_ADD, VERSION_GANTT_EDIT } from '../../../const/ApiConst'; +import { VERSION_GANTT_ADD, VERSION_GANTT_EDIT, USER_VERSION_GANTT_ADD } from '../../../const/ApiConst'; import { Select } from 'antd'; import 'antd/dist/antd.css'; -const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask, parentId, dataEdit, typeDialog}) => { +const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask, parentId, dataEdit, typeDialog, user_id }) => { const token = localStorage.getItem("token") const HEADER = { headers: { @@ -30,8 +30,7 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask, parent } } useEffect(() => { - if(typeDialog === "Edit") - { + if (typeDialog === "Edit") { setId(dataEdit.id); setName(dataEdit.name_version); setDesctription(dataEdit.description); @@ -77,6 +76,14 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask, parent .catch((error) => error.response); if (result && result.status == 200) { + const formData = { + user_id: user_id, + version_gantt_id: result.data.id + } + await axios + .post(USER_VERSION_GANTT_ADD, formData, HEADER) + .then(res => res) + .catch((error) => error.response); closeDialog('Save') } else { closeDialog('failed') @@ -87,7 +94,7 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask, parent const formData = { name_version: data.name, - description:data.description, + description: data.description, calculation_type: data.calculationType, proyek_id: idTask, hierarchy_ftth_id: parentId @@ -115,11 +122,11 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask, parent