diff --git a/src/components/dashboard/fastReact/supervisor/RowActions/RestoreForm/RestoreContent.jsx b/src/components/dashboard/fastReact/supervisor/RowActions/RestoreForm/RestoreContent.jsx
new file mode 100644
index 0000000..06c86a6
--- /dev/null
+++ b/src/components/dashboard/fastReact/supervisor/RowActions/RestoreForm/RestoreContent.jsx
@@ -0,0 +1,42 @@
+import { RESTORE_FAST_REACT } from "@/core/utils/routes";
+import useRequest from "@/lib/hooks/useRequest";
+import { Button, DialogActions, DialogContent, Stack, Typography } from "@mui/material";
+import { useState } from "react";
+
+const RestoreContent = ({ rowId, mutate, setOpenRestoreDialog }) => {
+ const [submitting, setSubmitting] = useState(false);
+ const requestServer = useRequest({ notificationSuccess: true });
+ const handleClick = () => {
+ setSubmitting(true);
+ requestServer(`${RESTORE_FAST_REACT}/${rowId}`, "post")
+ .then(() => {
+ mutate();
+ setOpenRestoreDialog(false);
+ setSubmitting(false);
+ })
+ .catch(() => {
+ setSubmitting(false);
+ });
+ };
+ return (
+ <>
+
+
+
+ آیا از بازگردانی فعالیت اطمینان دارید؟
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default RestoreContent;
diff --git a/src/components/dashboard/fastReact/supervisor/RowActions/RestoreForm/index.jsx b/src/components/dashboard/fastReact/supervisor/RowActions/RestoreForm/index.jsx
new file mode 100644
index 0000000..2632c20
--- /dev/null
+++ b/src/components/dashboard/fastReact/supervisor/RowActions/RestoreForm/index.jsx
@@ -0,0 +1,32 @@
+import React, { useState } from "react";
+import { Tooltip, IconButton, Dialog, DialogTitle } from "@mui/material";
+import ReplyIcon from "@mui/icons-material/Reply";
+import RestoreContent from "./RestoreContent";
+const RestoreForm = ({ rowId, mutate }) => {
+ const [openRestoreDialog, setOpenRestoreDialog] = useState(false);
+
+ return (
+ <>
+
+ setOpenRestoreDialog(true)}>
+
+
+
+
+ >
+ );
+};
+export default RestoreForm;
diff --git a/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx b/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx
index bf60960..b889295 100644
--- a/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx
+++ b/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx
@@ -2,12 +2,14 @@ import { Box } from "@mui/material";
import ConfirmForm from "./ConfirmDialog";
import RejectForm from "./RejectDialog";
import { usePermissions } from "@/lib/hooks/usePermissions";
+import RestoreForm from "./RestoreForm";
const RowActions = ({ row, mutate }) => {
const { data: userPermissions } = usePermissions();
const hasSupervisePermission = userPermissions.some((item) =>
["supervise-fast-react", "supervise-fast-react-province"].includes(item)
);
+ const hasRestorePermission = userPermissions.includes("restore-fast-react");
return (
{hasSupervisePermission && row.original?.status === 0 && (
@@ -16,6 +18,7 @@ const RowActions = ({ row, mutate }) => {
{hasSupervisePermission && row.original?.status === 0 && (
)}
+ {hasRestorePermission && }
);
};
diff --git a/src/core/utils/routes.js b/src/core/utils/routes.js
index 1bee5c2..7fa077c 100644
--- a/src/core/utils/routes.js
+++ b/src/core/utils/routes.js
@@ -119,3 +119,4 @@ export const REJECT_BY_FAST_REACT_SUPERVISOR = api + "/api/v3/road_observations/
export const GET_FAST_REACT_OPERATOR = api + "/api/v3/road_observations/operator_index";
export const GET_FAST_REACT_REFER_LIST = api + "/api/v3/road_observations/refer_list";
export const REFER_FAST_REACT = api + "/api/v3/road_observations/refer";
+export const RESTORE_FAST_REACT = api + "/api/v3/road_observations/restore";