diff --git a/src/components/UserTable.tsx b/src/components/UserTable.tsx index 1856edeb..24177bc1 100644 --- a/src/components/UserTable.tsx +++ b/src/components/UserTable.tsx @@ -95,8 +95,8 @@ const UserTable: React.FC = ({ const [selectedUserId, setSelectedUserId] = useState(""); const [selectedReason, setSelectedReason] = useState(""); const [otherReason, setOtherReason] = useState(""); - // const isMobile = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm')); - const isMobile = useMediaQuery((theme: Theme) => theme.breakpoints.down('md')); + const isMobile = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm')); + // const isMobile = useMediaQuery("(max-width:600px)"); const [confirmButtonDisable, setConfirmButtonDisable] = useState(false); @@ -316,6 +316,7 @@ const handleCloseAddTeamLeaderModal = () => { ); const getValue = (data: any, field: any) => { + console.log(data, field) if (item.default) { return item.default; } @@ -333,7 +334,16 @@ const handleCloseAddTeamLeaderModal = () => { return parseInt(String(field?.value)); } else if (item?.type === "text") { return String(field?.value); - } else { + } + + else { + console.log("asakas",field?.value) + if(field.value ==='FEMALE' || field.value ==='MALE') + { + console.log(true) + return field?.value?.toLowerCase(); + } + // console.log() return field?.value; } } @@ -595,7 +605,7 @@ const handleCloseAddTeamLeaderModal = () => { ) : data.length !== 0 && loading === false ? ( { title: t("FORM.NAME"), dataType: DataType.String, sortDirection: SortDirection.Ascend, - width: isMobile?160:null, + width:isMobile?160:null, }, { @@ -16,7 +16,7 @@ export const getUserTableColumns = (t: any, isMobile: any) => { title: t("FORM.STATUS"), dataType: DataType.String, sortDirection: SortDirection.Ascend, - width: isMobile?160:null, + width:isMobile?160:null, }, @@ -24,26 +24,26 @@ export const getUserTableColumns = (t: any, isMobile: any) => { key: "age", title: t("FORM.AGE"), dataType: DataType.String, - width: isMobile?160:null, + width:isMobile?160:null, }, { key: "gender", title: t("FORM.GENDER"), dataType: DataType.String, - width: isMobile?160:null, + width:isMobile?160:null, }, { key: "mobile", title: t("FORM.MOBILE_NUMBER"), dataType: DataType.String, - width: isMobile?160:null, + width:isMobile?160:null, }, { key: "state", title: t("FORM.STATE"), dataType: DataType.String, sortDirection: SortDirection.Ascend, - width: isMobile?160:null, + width:isMobile?160:null, }, { key: "district", @@ -58,7 +58,7 @@ export const getUserTableColumns = (t: any, isMobile: any) => { title: t("FORM.BLOCK"), dataType: DataType.String, sortDirection: SortDirection.Ascend, - width: isMobile?160:null, + width:isMobile?160:null, }, { key: "centers", @@ -77,7 +77,7 @@ export const getUserTableColumns = (t: any, isMobile: any) => { } -export const getTLTableColumns = (t: any) => { +export const getTLTableColumns = (t: any, isMobile:any) => { return[ { @@ -85,13 +85,15 @@ export const getTLTableColumns = (t: any) => { title: t("FORM.NAME"), dataType: DataType.String, sortDirection: SortDirection.Ascend, + // width: isMobile?160:null, + }, { key: "status", title: t("FORM.STATUS"), dataType: DataType.String, sortDirection: SortDirection.Ascend, - //width: isMobile?160:null, + // width: isMobile?160:null, }, @@ -99,13 +101,13 @@ export const getTLTableColumns = (t: any) => { key: "age", title: t("FORM.AGE"), dataType: DataType.String, - // width: 160, + // width: isMobile?160:null, }, { key: "gender", title: t("FORM.GENDER"), dataType: DataType.String, - // width: 160, + // width: isMobile?160:null, }, { @@ -113,14 +115,14 @@ export const getTLTableColumns = (t: any) => { title: t("FORM.STATE"), dataType: DataType.String, sortDirection: SortDirection.Ascend, - // width: 160, + // width: isMobile?160:null, }, { key: "district", title:t("FORM.DISTRICT"), dataType: DataType.String, sortDirection: SortDirection.Ascend, - // width: 160, + // width: isMobile?160:null, }, { @@ -128,14 +130,14 @@ export const getTLTableColumns = (t: any) => { title: t("FORM.BLOCK"), dataType: DataType.String, sortDirection: SortDirection.Ascend, - // width: 160, + // width: isMobile?160:null, }, { key: "actions", title: t("FORM.ACTION"), dataType: DataType.String, - // width: 160, + // width: isMobile?160:null, }, ]; } diff --git a/src/utils/useLocationState.tsx b/src/utils/useLocationState.tsx index dc7cc91d..14a17ee7 100644 --- a/src/utils/useLocationState.tsx +++ b/src/utils/useLocationState.tsx @@ -90,29 +90,35 @@ export const useLocationState = (open: boolean, onClose: () => void) => { try { console.log(selectedStateCode, selectedDistrictCode); const object = { - limit: 200, - offset: 0, - filters: { - type: "BLOCK", - status: ["active"], - // "states": selectedStateCode, - // "districts": selectedDistrictCode, - // "blocks": selectedCodes[0] - name: selected[0], - }, + "limit":200, + "offset": 0, + "filters": { + // "type": "COHORT", + "status": [ + "active" + ], + "states": selectedStateCode, + "districts": selectedDistrictCode, + "blocks": selectedCodes[0] + // name:selected[0] + } }; const response2 = await getCenterList(object); - console.log(selected); - const getBlockIdObject = { - limit: 200, - offset: 0, - filters: { - type: "BLOCK", - status: ["active"], - name: selected[0], - }, - }; + console.log(selected) + const getBlockIdObject={ + "limit": 200, + "offset": 0, "filters": { + // "type":"COHORT", + "status": [ + "active" + ], + "states": selectedStateCode, + "districts": selectedDistrictCode, + "blocks": selectedCodes[0] + // "name": selected[0] + }, + } const response = await getCenterList(getBlockIdObject); setSelectedBlockFieldId( response?.result?.results?.cohortDetails[0].cohortId