Skip to content

Commit

Permalink
adhoc changes (#1621)
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
nipunarora-eGov authored Oct 22, 2024
1 parent 1e5f11d commit e11d4ba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const defaultSearchValues = {
type: "text",
populators: {
name: "microplanName",
error: "Required",
validation: { pattern: /^[A-Za-z]+$/i },
// error: "Required",
// validation: { pattern: /^[A-Za-z]+$/i },
},
},
// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,15 @@ const createUpdatePlanProject = async (req) => {
})
const formulasToUpdate = totalFormData?.FORMULA_CONFIGURATION?.formulaConfiguration?.formulaConfigValues?.filter(row => {
return (row.category && row.output && row.input && row.operatorName && row.assumptionValue)
})?.map((row)=>{
const updatedRow = {...row}
const operatorName = row?.operatorName
delete updatedRow?.operatorName
updatedRow.operator = state?.RuleConfigureOperators?.find(operation => operation.
operatorName === operatorName)?.operatorCode
return updatedRow;
})

const updatedPlanObjFormula = {
...fetchedPlanForFormula,
operations:[
Expand All @@ -382,9 +390,7 @@ const createUpdatePlanProject = async (req) => {
}else {
setShowToast({ key: "error", label: "ERR_ASSUMPTIONS_FORM_UPDATE" });
}




case "UPLOADBOUNDARYDATA":
const fetchedPlanForBoundary = await searchPlanConfig({
PlanConfigurationSearchCriteria: {
Expand Down Expand Up @@ -515,6 +521,14 @@ const createUpdatePlanProject = async (req) => {
} else {
setShowToast({ key: "error", label: "ERR_FAILED_TO_COMPLETE_SETUP" });
}

case "ROLE_ACCESS_CONFIGURATION":
//run any api validations if any/
setCurrentKey((prev) => prev + 1);
setCurrentStep((prev) => prev + 1);
return {
triggeredFrom,
};
default:
setShowToast({ key: "error", label: "ERROR_UNHANDLED_NEXT_OPERATION" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const SearchSavedPlansWithCampaign = async (body) => {
});

const listOfPlans = planEmployeeSearch?.PlanEmployeeAssignment?.map((i) => i.planConfigurationId);
if(listOfPlans.length===0){
return []
}

//here get response from both apis and process data and return
const responsePlan = await Digit.CustomService.getResponse({
Expand All @@ -55,7 +58,7 @@ const SearchSavedPlansWithCampaign = async (body) => {
status: body?.PlanConfigurationSearchCriteria?.status,
limit: body?.PlanConfigurationSearchCriteria?.limit,
offset: body?.PlanConfigurationSearchCriteria?.offset,
id: listOfPlans?.[0],
ids: listOfPlans,
},
},
});
Expand Down

0 comments on commit e11d4ba

Please sign in to comment.