disable filter for city province and role
This commit is contained in:
@@ -16,17 +16,15 @@ import {
|
||||
} from "@mui/material";
|
||||
import {useEffect, useState} from "react";
|
||||
import {useFormik} from "formik";
|
||||
import {GET_CITY_LIST, GET_PROVINCE_LIST, GET_ROLE_LIST, UPDATE_EXPERT_MANAGEMENT} from "@/core/data/apiRoutes";
|
||||
import {GET_CITY_LIST, UPDATE_EXPERT_MANAGEMENT} from "@/core/data/apiRoutes";
|
||||
import * as Yup from "yup";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import useProvince from "@/lib/app/hooks/useProvince";
|
||||
import useRole from "@/lib/app/hooks/useRole";
|
||||
|
||||
|
||||
const UpdateContent = ({row, fetchUrl, mutate, setOpenUpdateDialog}) => {
|
||||
const t = useTranslations();
|
||||
const requestServer = useRequest();
|
||||
// const [provinceList, setProvinceList] = useState([]);
|
||||
const [cityList, setCityList] = useState([]);
|
||||
const [citiesExist, setCitiesExist] = useState(false);
|
||||
const [cityTextField, setCityTextField] = useState(t("ExpertMangement.text_field_please_select_province"));
|
||||
@@ -74,7 +72,7 @@ const UpdateContent = ({row, fetchUrl, mutate, setOpenUpdateDialog}) => {
|
||||
position: row.original.position,
|
||||
province_id: row.original.province_id,
|
||||
city_id: row.original.city_id,
|
||||
role_id: row.original.role_id
|
||||
role_id: row.original.roles[0].id
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
@@ -299,7 +297,7 @@ const UpdateContent = ({row, fetchUrl, mutate, setOpenUpdateDialog}) => {
|
||||
<Select
|
||||
name="role_id"
|
||||
label={t("ExpertMangement.text_field_role_id")}
|
||||
value={roleList ? formik.values.role_id && 1 : ""}
|
||||
value={roleList ? formik.values.role_id : ""}
|
||||
onChange={formik.handleChange}
|
||||
onBlur={formik.handleBlur}
|
||||
fullWidth
|
||||
|
||||
@@ -106,9 +106,9 @@ function DashboardExpertManagementComponent() {
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.province_name,
|
||||
id: "province_id",
|
||||
id: "province_name",
|
||||
header: t("ExpertMangement.province_name"),
|
||||
enableColumnFilter: true,
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "contains",
|
||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
@@ -118,9 +118,9 @@ function DashboardExpertManagementComponent() {
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.city_name,
|
||||
id: "city_id",
|
||||
id: "city_name",
|
||||
header: t("ExpertMangement.city_name"),
|
||||
enableColumnFilter: true,
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "contains",
|
||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
@@ -129,10 +129,10 @@ function DashboardExpertManagementComponent() {
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.role_name,
|
||||
id: "role_id",
|
||||
accessorFn: (row) => row.roles[0].name_fa,
|
||||
id: "roles[0].name_fa",
|
||||
header: t("ExpertMangement.role_name"),
|
||||
enableColumnFilter: true,
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "contains",
|
||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
|
||||
Reference in New Issue
Block a user