From f9cbc4ad8b452f19eac6a94e4a487c0ff67de5cb Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:49:04 +0700 Subject: [PATCH] update payload --- .../CreatedProyek/DialogAssignCust.js | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/DialogAssignCust.js b/src/views/SimproV2/CreatedProyek/DialogAssignCust.js index 940250c..c680615 100644 --- a/src/views/SimproV2/CreatedProyek/DialogAssignCust.js +++ b/src/views/SimproV2/CreatedProyek/DialogAssignCust.js @@ -3,7 +3,7 @@ import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { Button, Form } from 'reactstrap'; import axios from "../../../const/interceptorApi"; import { - USER_LIST, + USER_SEARCH, ASSIGN_HR_PROJECT_SEARCH, ASSIGN_HR_PROJECT_ADD_MULTIPLE } from '../../../const/ApiConst'; @@ -40,8 +40,29 @@ const DialogAssignCust = ({ openDialog, closeDialog, toggleDialog, idTask }) => const getDataAssignCustomer = async () => { + const payload = { + "select": [ + "id", + "name", + "role_id" + ], + "paging": { + "start": 0, + "length": -1 + }, + "columns": [ + { "name": "role_id", "logic_operator": "=", "value": 44 } + ], + "orders": { + "columns": [ + "id" + ], + "ascending": false + } + } + const URL = USER_SEARCH; const result = await axios - .get(USER_LIST, HEADER) + .post(URL, payload, HEADER) .then(res => res) .catch((error) => error.response); @@ -99,6 +120,12 @@ const DialogAssignCust = ({ openDialog, closeDialog, toggleDialog, idTask }) => const getCustProject = async () => { const payload = { + "select": [ + "id", + "user_id", + "proyek_id", + "is_customer" + ], "columns": [ { "name": "proyek_id", "logic_operator": "=", "value": idTask }, {"name": "is_customer", "logic_operator": "=", "value": "true"}