Skip to content

Commit

Permalink
Merge pull request #245 from icefoganalytics/test
Browse files Browse the repository at this point in the history
Fixing in recalc too
  • Loading branch information
datajohnson authored Feb 13, 2024
2 parents 4676f61 + 11ede24 commit 100f32e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,11 @@ const actions = {
dependentCount = store.getters.selectedStudent.dependent_info.filter(
(d) => d.is_csg_eligible && d.application_id == state.fundingRequest.application_id
).length;

familySize += store.getters.selectedStudent.dependent_info.filter(
(d) => d.is_csl_eligible && d.application_id == state.fundingRequest.application_id
).length;
}
familySize += dependentCount;

let parent = state.parentAssessment;
let assessment = {
Expand Down Expand Up @@ -264,7 +267,6 @@ const actions = {
(d) => d.is_csg_eligible && d.application_id == state.fundingRequest.application_id
).length;


familySize += store.getters.selectedStudent.dependent_info.filter(
(d) => d.is_csl_eligible && d.application_id == state.fundingRequest.application_id
).length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const actions = {
(d) => d.is_csg_eligible && d.application_id == state.fundingRequest.application_id
).length;
}

let parent = state.parentAssessment;
let assessment = {
assessed_date: moment().format("YYYY-MM-DD"),
Expand Down Expand Up @@ -230,6 +230,13 @@ const actions = {
async recalculate({ state, dispatch, commit }) {
dispatch("loadAssessment", state.fundingRequest.application_id).then(() => {
let parent = state.parentAssessment;
let dependentCount = 0;

if (store.getters.selectedStudent && isArray(store.getters.selectedStudent.dependent_info)) {
dependentCount = store.getters.selectedStudent.dependent_info.filter(
(d) => d.is_csg_eligible && d.application_id == state.fundingRequest.application_id
).length;
}

let assessment = {
id: state.assessment.id,
Expand All @@ -239,7 +246,7 @@ const actions = {
classes_end_date: moment.utc(parent.classes_end_date).format("YYYY-MM-DD"),
study_months: parent.study_months,
family_size: parent.family_size,
dependent_count: parent.dependent_count,
dependent_count: dependentCount,
student_ln150_income: parent.student_ln150_income,
spouse_ln150_income: parent.spouse_ln150_income,
parent1_income: parent.parent1_income,
Expand Down

0 comments on commit 100f32e

Please sign in to comment.