From 85f53751b34bc238b502b9c55bd56ec2ae0e8204 Mon Sep 17 00:00:00 2001 From: ibnu Date: Mon, 14 Aug 2023 07:24:40 +0700 Subject: [PATCH] update logic getData Project and add spinner loading --- src/views/SimproV2/CreatedProyek/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index 61d686d..3f18271 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -19,7 +19,7 @@ import { Tooltip, Popover, Skeleton, - Divider, + Spin, } from "antd"; import { PROJECT_APPROVAL_ADD, @@ -134,6 +134,7 @@ const CreatedProyek = ({ params, ...props }) => { const [dataVersionGantt, setDataVersionGantt] = useState([]); const [dataHierarchy, setDataHierarchy] = useState([]); const [dataDetail, setDataDetail] = useState(null); + const [loading, setLoading] = useState(true); const pageName = params.name; @@ -244,6 +245,8 @@ const CreatedProyek = ({ params, ...props }) => { operator: "AND", }, ], + select: ["id", "nama", "rencana_biaya", + "currency_symbol", "mulai_proyek", "akhir_proyek"], joins: [ { name: "m_users", @@ -273,13 +276,14 @@ const CreatedProyek = ({ params, ...props }) => { .then((res) => res) .catch((error) => error.response); - if (result && result.data && result.data.code == 200) { let dataRes = result.data.data || []; setDatatable(dataRes); setTotalPage(result.data.totalRecord); + setLoading(false); } else { + setLoading(false); NotificationManager.error("Gagal Mengambil Data!!", "Failed"); } }; @@ -1466,7 +1470,10 @@ const CreatedProyek = ({ params, ...props }) => { - {RenderTable} + + {RenderTable} + +