Skip to content

Commit

Permalink
Monthly leave dates table no records found error issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lahirulakruwan committed Oct 24, 2024
1 parent 5482360 commit b8163a0
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 b8163a0

Please sign in to comment.