Skip to content

Commit

Permalink
fix: leave api
Browse files Browse the repository at this point in the history
Signed-off-by: Aman <aman2@me.iitr.ac.in>
  • Loading branch information
aman-singh7 committed Sep 24, 2023
1 parent 7f94b71 commit 766f5a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/data/services/remote/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ abstract class ApiService {
// Leave API

@GET(ApiEndpoints.remainingLeaves)
Future<int> remainingLeaves();
Future remainingLeaves();

@GET(ApiEndpoints.getLeaves)
Future<PaginatedLeaves> getLeaves(
Expand Down
4 changes: 3 additions & 1 deletion lib/domain/repositories/leave/leave_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ class LeaveRepository {

Future<int> remainingLeaves() async {
try {
return await _apiService.remainingLeaves();
final response = await _apiService.remainingLeaves();
return response["count"]!;
} catch (e) {
// TODO: Handle error
debugPrint(e.toString());
return 0;
}
}
Expand Down

0 comments on commit 766f5a0

Please sign in to comment.