change route of loan reserve

This commit is contained in:
Yasiu1376
2024-02-12 15:18:39 +03:30
parent cf8d33adf7
commit 2eaa6c5242
5 changed files with 14 additions and 12 deletions

View File

@@ -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",

View File

@@ -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()

View File

@@ -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()

View File

@@ -4,10 +4,10 @@ import CanselReserve from "./Form/CanselReserve";
const TableRow = ({row, mutate}) => {
return (
<Box sx={{display: "flex", flexWrap: "nowrap", gap: "8px"}}>
{/*<CanselReserve*/}
{/* rowId={row.getValue("id")}*/}
{/* mutate={mutate}*/}
{/*/>*/}
<CanselReserve
rowId={row.getValue("id")}
mutate={mutate}
/>
</Box>
);
};

View File

@@ -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