Skip to content

Commit

Permalink
board_detail: show move to column api error message
Browse files Browse the repository at this point in the history
  • Loading branch information
sstasi95 committed Feb 7, 2025
1 parent 38f4e75 commit a6adbaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/src/screens/board_detail/base_board_detail.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
library board_detail;

import 'package:azure_devops/src/mixins/api_error_mixin.dart';
import 'package:azure_devops/src/models/board.dart';
import 'package:azure_devops/src/models/work_items.dart';
import 'package:azure_devops/src/router/router.dart';
Expand Down
7 changes: 5 additions & 2 deletions lib/src/screens/board_detail/controller_board_detail.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
part of board_detail;

class _BoardDetailController {
class _BoardDetailController with ApiErrorHelper {
_BoardDetailController._(this.api, this.args);

final AzureApiService api;
Expand Down Expand Up @@ -96,7 +96,10 @@ class _BoardDetailController {
formFields: {boardWithItems.value!.data!.board.fields.columnField.referenceName: column!},
);

if (res.isError) return OverlayService.error('Error', description: 'Item not updated');
if (res.isError) {
final errorMessage = getErrorMessageAndType(res.errorResponse!);
return OverlayService.error('Error', description: 'Item not updated.\n${errorMessage.msg}');
}

OverlayService.snackbar('Item successfully moved to column $column');
await init();
Expand Down

0 comments on commit a6adbaf

Please sign in to comment.