Skip to content

Commit

Permalink
Merge pull request #178 from lahirulakruwan/main
Browse files Browse the repository at this point in the history
Monthly leave dates table  no records found error issue fixed
  • Loading branch information
YujithIsura authored Oct 25, 2024
2 parents c9ebd54 + 677852a commit 04c1b60
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions api/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -6054,12 +6054,23 @@ AND p.organization_id IN (

if (monthly_leave_dates_raw is MonthlyLeaveDates) {
return new (0,monthly_leave_dates_raw);
}else{
// Return a new empty MonthlyLeaveDates object if no record is found
MonthlyLeaveDates emptyLeaveDates = {
id: null,
year: null,
month: null,
organization_id: null,
leave_dates_list: [],
daily_amount: null,
created: null,
updated: null,
total_days_in_month: null,
leave_dates: null
};
return new(0,emptyLeaveDates);
}

}

return error("Provide not null value for organization_id and year and month.");

}

}
Expand Down

0 comments on commit 04c1b60

Please sign in to comment.