Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
nhannah committed Sep 12, 2024
1 parent 95bd0b7 commit b8afa26
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/test_track/lib/src/domain/get_visitor_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class GetVisitorConfig {
'${appVersionBuild.buildTimestamp}/visitors/$visitorId/config',
),
onResponse: (r) => switch (r) {
Ok(:final response) => AppVisitorConfig.fromJson(response),
OkResponse(:final response) => AppVisitorConfig.fromJson(response),
_ => throw Exception(r.toString()),
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class OverrideAssignments {
}),
),
onResponse: (r) => switch (r) {
NoContent() => null,
OkNoContent() => null,
_ => throw Exception('Failed to override assignments: $r'),
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ReportAssignmentEvent {
),
),
onResponse: (r) => switch (r) {
NoContent() => null,
OkNoContent() => null,
_ => _logger.error('Unable to report assignment event: $assignmentEvent with error: $r'),
},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/test_track/lib/src/domain/test_track_login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Login {
),
),
onResponse: (r) => switch (r) {
Ok(:final response) => AppVisitorConfig.fromJson(response),
OkResponse(:final response) => AppVisitorConfig.fromJson(response),
_ => throw TestTrackLoginFailureException(message: r.toString()),
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ class RetryInterceptor extends Interceptor {
// most cases, and would require a `sturdy_http` change if we want
// to gain access to the raw response.
switch (r) {
case Ok(:final response):
case OkResponse(:final response):
handler.resolve(
Response(
data: response,
requestOptions: err.requestOptions,
),
);
case NoContent():
case OkNoContent():
handler.resolve(
Response(
statusCode: 204,
Expand Down

0 comments on commit b8afa26

Please sign in to comment.