diff --git a/src/pages/block.tsx b/src/pages/block.tsx index 958ec1dc..2e064a63 100644 --- a/src/pages/block.tsx +++ b/src/pages/block.tsx @@ -94,7 +94,7 @@ const Block: React.FC = () => { const [editState, setEditState] = useState(null); const [selectedStateForEdit, setSelectedStateForEdit] = useState(null); - const [blocksFieldId, setBlocksFieldId] = useState(""); + const [blocksFieldId, setBlocksFieldId] = useState("4aab68ae-8382-43aa-a45a-e9b239319857"); const [districtFieldId, setDistrictFieldId] = useState(""); const [sortBy, setSortBy] = useState<[string, string]>(["name", "asc"]); const [paginationCount, setPaginationCount] = useState(0); @@ -299,7 +299,7 @@ const Block: React.FC = () => { const blockCodeArray = blocks.map((item: any) => item.value); setBlockCodeArr(blockCodeArray); - const blockFieldID = response?.result?.fieldId || ""; + const blockFieldID = response?.result?.fieldId || "4aab68ae-8382-43aa-a45a-e9b239319857"; setBlocksFieldId(blockFieldID); } catch (error) { console.error("Error fetching blocks", error); diff --git a/src/pages/district.tsx b/src/pages/district.tsx index dae0a49a..f44720e4 100644 --- a/src/pages/district.tsx +++ b/src/pages/district.tsx @@ -68,7 +68,7 @@ const District: React.FC = () => { useState(null); const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false); - const [districtFieldId, setDistrictFieldId] = useState(""); + const [districtFieldId, setDistrictFieldId] = useState("b61edfc6-3787-4079-86d3-37262bf23a9e"); const [loading, setLoading] = useState(false); const [selectedSort, setSelectedSort] = useState("Sort"); const [pageCount, setPageCount] = useState(Numbers.ONE); @@ -147,7 +147,7 @@ const District: React.FC = () => { const districtCodeArray = districts.map((item: any) => item.value); setDistrictCodeArr(districtCodeArray); - const districtFieldID = data?.result?.fieldId || ""; + const districtFieldID = data?.result?.fieldId || "b61edfc6-3787-4079-86d3-37262bf23a9e"; setDistrictFieldId(districtFieldID); } catch (error) { console.error("Error fetching districts", error); @@ -446,7 +446,7 @@ const District: React.FC = () => { if (cohortCreateResponse) { filteredCohortOptionData(); showToastMessage(t("COMMON.DISTRICT_ADDED_SUCCESS"), "success"); - } else if (cohortCreateResponse.responseCode === 409) { + } else if (cohortCreateResponse?.responseCode === 409) { showToastMessage(t("COMMON.DISTRICT_DUPLICATION_FAILURE"), "error"); } } catch (error) {