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

v0.4.1 — Added missing isWeb #10

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading