Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
Added missing isWeb (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlessenich authored Feb 26, 2024
1 parent 6ea4e9e commit 012f947
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.4.1
- Added missing `isWeb`

## 0.4
- Added `statusCode` to `RestResponse`
- Moved route config to `RouteOptions`
Expand Down
6 changes: 3 additions & 3 deletions lib/src/service/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class RequestHandler {
String contentType = 'application/json'}) async {
try {
final Response<dynamic> response =
await route.submit(routeOptions: routeOptions, body: body, contentType: contentType);
await route.submit(routeOptions: routeOptions, body: body, isWeb: isWeb, contentType: contentType);
return RestResponse(data: mapper.call(response.data), statusCode: response.statusCode);
} on DioException catch (e) {
return _handleDioException(e, isWeb, errorMap);
Expand All @@ -40,7 +40,7 @@ class RequestHandler {
String contentType = 'application/json'}) async {
try {
final Response<dynamic> response =
await route.submit(routeOptions: routeOptions, body: body, contentType: contentType);
await route.submit(routeOptions: routeOptions, body: body, isWeb: isWeb, contentType: contentType);
return RestResponse(data: true, statusCode: response.statusCode);
} on DioException catch (e) {
return _handleDioException(e, isWeb, errorMap);
Expand All @@ -62,7 +62,7 @@ class RequestHandler {
String contentType = 'application/json'}) async {
try {
final Response<dynamic> response =
await route.submit(routeOptions: routeOptions, body: body, contentType: contentType);
await route.submit(routeOptions: routeOptions, body: body, isWeb: isWeb, contentType: contentType);
if (response.data is! List<dynamic>) {
throw StateError('Received response is not a list!');
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: restrr
description: Dart package which allows to communicate with the financrr REST API.
version: 0.4.0
version: 0.4.1
repository: https://github.com/financrr/restrr

environment:
Expand Down

0 comments on commit 012f947

Please sign in to comment.