[wip] implementing technical deputy list table
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import DialogLoading from "@/core/components/DialogLoading";
|
||||
import { GET_REQUEST_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT_DETAILS } from "@/core/utils/routes";
|
||||
import { GET_REQUEST_INQUIRY_PRIVACY } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { DialogContent, Typography } from "@mui/material";
|
||||
import { useEffect, useState } from "react";
|
||||
@@ -14,7 +14,7 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await request(`${GET_REQUEST_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT_DETAILS}/${rowId}`);
|
||||
const response = await request(`${GET_REQUEST_INQUIRY_PRIVACY}/${rowId}`);
|
||||
setData(response.data.data);
|
||||
} catch (error) {
|
||||
} finally {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import DialogLoading from "@/core/components/DialogLoading";
|
||||
import { GET_REQUEST_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT_DETAILS } from "@/core/utils/routes";
|
||||
import { GET_REQUEST_INQUIRY_PRIVACY } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { DialogContent, Typography } from "@mui/material";
|
||||
import { useEffect, useState } from "react";
|
||||
@@ -14,7 +14,7 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await request(`${GET_REQUEST_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT_DETAILS}/${rowId}`);
|
||||
const response = await request(`${GET_REQUEST_INQUIRY_PRIVACY}/${rowId}`);
|
||||
setData(response.data.data);
|
||||
} catch (error) {
|
||||
} finally {
|
||||
@@ -28,9 +28,8 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => {
|
||||
return (
|
||||
<>
|
||||
{loading ? (
|
||||
<div>Loading...</div>
|
||||
) : // <DialogLoading />
|
||||
data ? (
|
||||
<DialogLoading loadingOpen={loading} />
|
||||
) : data ? (
|
||||
<ConfirmRoadSafetyFormContext
|
||||
row={row}
|
||||
rowId={rowId}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import DialogLoading from "@/core/components/DialogLoading";
|
||||
import { GET_REQUEST_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT_DETAILS } from "@/core/utils/routes";
|
||||
import { GET_REQUEST_INQUIRY_PRIVACY } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { DialogContent, Typography } from "@mui/material";
|
||||
import { useEffect, useState } from "react";
|
||||
@@ -14,7 +14,7 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await request(`${GET_REQUEST_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT_DETAILS}/${rowId}`);
|
||||
const response = await request(`${GET_REQUEST_INQUIRY_PRIVACY}/${rowId}`);
|
||||
setData(response.data.data);
|
||||
} catch (error) {
|
||||
} finally {
|
||||
@@ -28,9 +28,15 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => {
|
||||
return (
|
||||
<>
|
||||
{loading ? (
|
||||
<DialogLoading />
|
||||
<DialogLoading loadingOpen={loading} />
|
||||
) : data ? (
|
||||
<ConfirmRoadSafetyFormContext row={row} rowId={rowId} data={data} mutate={mutate} handleClose={handleClose} />
|
||||
<ConfirmRoadSafetyFormContext
|
||||
row={row}
|
||||
rowId={rowId}
|
||||
data={data}
|
||||
mutate={mutate}
|
||||
handleClose={handleClose}
|
||||
/>
|
||||
) : (
|
||||
<DialogContent>
|
||||
<Typography textAlign={"center"}>اطلاعات درخواست در سامانه یافت نشد</Typography>
|
||||
@@ -38,6 +44,5 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => {
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
}
|
||||
export default ConfirmRoadSafetyDialog
|
||||
};
|
||||
export default ConfirmRoadSafetyDialog;
|
||||
|
||||
@@ -5,18 +5,17 @@ import ConfirmVerifyLicenseForm from "./ConfirmVerifyLicenseForm";
|
||||
|
||||
const RowActions = ({ row, mutate }) => {
|
||||
return (
|
||||
<></>
|
||||
// <Box sx={{ display: "flex", gap: 1 }}>
|
||||
// {row.original.state_id == 3 && (
|
||||
// <ConfirmRoadSafetyForm row={row} mutate={mutate} rowId={row.getValue("id")} />
|
||||
// )}
|
||||
// {row.original.state_id == 6 && (
|
||||
// <ConfirmVerifyRoadSafetyForm row={row} mutate={mutate} rowId={row.getValue("id")} />
|
||||
// )}
|
||||
// {row.original.state_id == 14 && (
|
||||
// <ConfirmVerifyLicenseForm row={row} mutate={mutate} rowId={row.getValue("id")} />
|
||||
// )}
|
||||
// </Box>
|
||||
<Box sx={{ display: "flex", gap: 1 }}>
|
||||
{row.original.state_id == 3 && (
|
||||
<ConfirmRoadSafetyForm row={row} mutate={mutate} rowId={row.getValue("id")} />
|
||||
)}
|
||||
{row.original.state_id == 6 && (
|
||||
<ConfirmVerifyRoadSafetyForm row={row} mutate={mutate} rowId={row.getValue("id")} />
|
||||
)}
|
||||
{row.original.state_id == 14 && (
|
||||
<ConfirmVerifyLicenseForm row={row} mutate={mutate} rowId={row.getValue("id")} />
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
export default RowActions;
|
||||
|
||||
Reference in New Issue
Block a user