Merge branch 'feature/fixedApiAndCommercialCheifPage' into 'develop'
Feature/fixed api and commercial cheif page See merge request witel3/loan-facilities-expert!67
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
"sidebar": {
|
||||
"dashboard": "داشبورد",
|
||||
"passenger-office-chief": "اداره مسافر",
|
||||
"machinary-expert": "ماشین آلات",
|
||||
"machinery-expert": "ماشین آلات",
|
||||
"passenger-boss": "رئیس مسافر ",
|
||||
"transportation-assistant": "معاونت حمل و نقل",
|
||||
"province-manager": "مدیر کل استانی",
|
||||
|
||||
@@ -38,13 +38,14 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
initialValues: {
|
||||
description: "",
|
||||
proposed_amount: "",
|
||||
confirm_img: ""
|
||||
confirm_img: null
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("proposed_amount", values.proposed_amount);
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_MACHINARY_OFFICE}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -68,7 +69,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,12 +38,13 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
reject_img: ""
|
||||
reject_img: null
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_MACHINARY_OFFICE}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -65,7 +66,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,13 +38,14 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
initialValues: {
|
||||
description: "",
|
||||
approved_amount: "",
|
||||
confirm_img: ""
|
||||
confirm_img: null
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("approved_amount", values.approved_amount);
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_PASSENGER_BOSS}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -68,7 +69,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,12 +38,13 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
reject_img: ""
|
||||
reject_img: null
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_PASSENGER_BOSS}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -65,7 +66,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,11 +33,12 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
confirm_img: ""
|
||||
confirm_img: null
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_PASSENGER_OFFICE}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -58,7 +59,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,12 +38,13 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
reject_img: ""
|
||||
reject_img: null
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_PASSENGER_OFFICE}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -65,7 +66,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,11 +33,12 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
confirm_img: ""
|
||||
confirm_img: null
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_PROVINCE_MANAGER}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -58,7 +59,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,12 +38,13 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
reject_img: ""
|
||||
reject_img: null
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_PROVINCE_MANAGER}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -65,7 +66,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,11 +33,12 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
confirm_img: ""
|
||||
confirm_img: null
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_TRANSPORTATION_ASSISTANCE}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -58,7 +59,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,12 +38,13 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
reject_img: ""
|
||||
reject_img: null
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_TRANSPORTATION_ASSISTANCE}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -65,7 +66,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(directionApp, t);
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,11 @@ const UploadFileNotification = (t) => {
|
||||
</>
|
||||
),
|
||||
{
|
||||
autoClose: false,
|
||||
autoClose: 3000,
|
||||
hideProgressBar: true,
|
||||
pauseOnHover: true,
|
||||
closeOnClick: false,
|
||||
draggable: false,
|
||||
draggable: true,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -25,9 +25,9 @@ const sidebarMenu = [
|
||||
role: "passenger_office_chief",
|
||||
},
|
||||
{
|
||||
key: "sidebar.machinary-expert",
|
||||
key: "sidebar.machinery-expert",
|
||||
type: "page",
|
||||
route: "/dashboard/machinary-expert",
|
||||
route: "/dashboard/machinery-expert",
|
||||
icon: <DirectionsCarFilledIcon/>,
|
||||
selected: false,
|
||||
role: "machinery_expert",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import DashboardMachinaryOfficeComponent from "@/components/dashboard/machinary-office";
|
||||
import DashboardMachineryOfficeComponent from "@/components/dashboard/machinary-office";
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
@@ -8,7 +8,7 @@ export default function PassengerOffice() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardMachinaryOfficeComponent/>
|
||||
<DashboardMachineryOfficeComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
Reference in New Issue
Block a user