Browse Source

update after created gantt add permission created

pull/1/head
farhantock 1 year ago
parent
commit
fcf47b144b
  1. 1
      src/views/SimproV2/CreatedProyek/AsignHrProject.js
  2. 15
      src/views/SimproV2/CreatedProyek/DialogFormGantt.js

1
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": {

15
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')

Loading…
Cancel
Save