From 2eaa6c5242301cc57acb9f7dbd29ca15d269cee1 Mon Sep 17 00:00:00 2001 From: Yasiu1376 Date: Mon, 12 Feb 2024 15:18:39 +0330 Subject: [PATCH] change route of loan reserve --- src/components/dashboard/bank-management/index.jsx | 4 ++-- .../dashboard/machinary-office/Form/ReserveForm/index.jsx | 2 +- .../dashboard/reserve-loan/Form/CanselReserve/index.jsx | 8 +++++--- src/components/dashboard/reserve-loan/TableRowActions.jsx | 8 ++++---- src/core/data/apiRoutes.js | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/dashboard/bank-management/index.jsx b/src/components/dashboard/bank-management/index.jsx index f89ee8a..94fa758 100644 --- a/src/components/dashboard/bank-management/index.jsx +++ b/src/components/dashboard/bank-management/index.jsx @@ -159,8 +159,8 @@ function DashboardBankManagementComponent() { ), }, { - accessorFn: (row) => row.bank_state, - id: "bank_state", + accessorFn: (row) => row.bank_state_name, + id: "bank_state_name", header: t("BankManagement.bank_state"), enableColumnFilter: true, datatype: "text", diff --git a/src/components/dashboard/machinary-office/Form/ReserveForm/index.jsx b/src/components/dashboard/machinary-office/Form/ReserveForm/index.jsx index 8056abc..e7b08fb 100644 --- a/src/components/dashboard/machinary-office/Form/ReserveForm/index.jsx +++ b/src/components/dashboard/machinary-office/Form/ReserveForm/index.jsx @@ -17,7 +17,7 @@ import {RESERVE_MACHINARY_LOAN} from "@/core/data/apiRoutes"; const ReserveForm = ({rowId, mutate}) => { const t = useTranslations(); const [openConfirmDialog, setOpenConfirmDialog] = useState(false); - const requestServer = useRequest({auth: true, notification: false}); + const requestServer = useRequest({auth: true, notification: true}); const [isSubmitting, setIsSubmitting] = useState(false); const {update_notification} = useNotification() diff --git a/src/components/dashboard/reserve-loan/Form/CanselReserve/index.jsx b/src/components/dashboard/reserve-loan/Form/CanselReserve/index.jsx index 6d6eb70..0af4f2a 100644 --- a/src/components/dashboard/reserve-loan/Form/CanselReserve/index.jsx +++ b/src/components/dashboard/reserve-loan/Form/CanselReserve/index.jsx @@ -12,16 +12,18 @@ import {useState} from "react"; import KeyboardReturnSharpIcon from '@mui/icons-material/KeyboardReturnSharp'; import useRequest from "@/lib/app/hooks/useRequest"; import {CANSEL_RESERVE_MACHINARY_LOAN} from "@/core/data/apiRoutes"; +import useNotification from "@/lib/app/hooks/useNotification"; const CanselReserve = ({rowId, mutate}) => { const t = useTranslations(); const [openConfirmDialog, setOpenConfirmDialog] = useState(false); - const requestServer = useRequest({auth: true, notification: false}); - const [isSubmitting, setIsSubmitting] = useState(false) + const requestServer = useRequest({auth: true, notification: true}); + const [isSubmitting, setIsSubmitting] = useState(false); + const {update_notification} = useNotification() const handleSubmit = () => { setIsSubmitting(true) - requestServer(`${CANSEL_RESERVE_MACHINARY_LOAN}/${rowId}`, 'get').then((response) => { + requestServer(`${CANSEL_RESERVE_MACHINARY_LOAN}/${rowId}`, 'post').then((response) => { setOpenConfirmDialog(false) mutate() update_notification() diff --git a/src/components/dashboard/reserve-loan/TableRowActions.jsx b/src/components/dashboard/reserve-loan/TableRowActions.jsx index 147ff26..207138d 100644 --- a/src/components/dashboard/reserve-loan/TableRowActions.jsx +++ b/src/components/dashboard/reserve-loan/TableRowActions.jsx @@ -4,10 +4,10 @@ import CanselReserve from "./Form/CanselReserve"; const TableRow = ({row, mutate}) => { return ( - {/**/} + ); }; diff --git a/src/core/data/apiRoutes.js b/src/core/data/apiRoutes.js index 8c5e197..3e62565 100644 --- a/src/core/data/apiRoutes.js +++ b/src/core/data/apiRoutes.js @@ -76,12 +76,12 @@ export const EXPORT_MACHINARY_OFFICE = export const GET_RESERVE_MACHINARY_LOAN = - BASE_URL + "/dashboard/machinery_expert/reserved/show"; + BASE_URL + "/dashboard/reserved_loan/show"; export const RESERVE_MACHINARY_LOAN = BASE_URL + "/dashboard/machinery_expert/reserve"; export const CANSEL_RESERVE_MACHINARY_LOAN = - BASE_URL + "/dashboard/machinery_expert/unreserved"; + BASE_URL + "/dashboard/reserved_loan/unreserve"; //machinary office //commercial chief