Skip to content

Commit

Permalink
Issue #PS-000 fix: Added fieldId for block and district
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Oct 15, 2024
1 parent 587b840 commit 45c12e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/pages/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Block: React.FC = () => {
const [editState, setEditState] = useState<StateDetail | null>(null);
const [selectedStateForEdit, setSelectedStateForEdit] =
useState<StateDetail | null>(null);
const [blocksFieldId, setBlocksFieldId] = useState<string>("");
const [blocksFieldId, setBlocksFieldId] = useState<string>("4aab68ae-8382-43aa-a45a-e9b239319857");
const [districtFieldId, setDistrictFieldId] = useState<string>("");
const [sortBy, setSortBy] = useState<[string, string]>(["name", "asc"]);
const [paginationCount, setPaginationCount] = useState<number>(0);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/pages/district.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const District: React.FC = () => {
useState<DistrictDetail | null>(null);
const [confirmationDialogOpen, setConfirmationDialogOpen] =
useState<boolean>(false);
const [districtFieldId, setDistrictFieldId] = useState<string>("");
const [districtFieldId, setDistrictFieldId] = useState<string>("b61edfc6-3787-4079-86d3-37262bf23a9e");
const [loading, setLoading] = useState<boolean>(false);
const [selectedSort, setSelectedSort] = useState("Sort");
const [pageCount, setPageCount] = useState<number>(Numbers.ONE);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 45c12e5

Please sign in to comment.