Skip to content

Commit

Permalink
fix:Unnecessary status update notification
Browse files Browse the repository at this point in the history
  • Loading branch information
angrezichatterbox committed Sep 9, 2024
1 parent 816f34e commit 8c9594a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
20 changes: 5 additions & 15 deletions lib/controllers/status/status_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ class StatusController extends GetxController {

if (response.statusCode == 200) {
await getStatus(date: date);
Get.snackbar(
'Status Updated',
'Status updated successfully!',
snackPosition: SnackPosition.BOTTOM,
);
// Get.snackbar(
// 'Status Updated',a
// 'Status updated successfully!',
// snackPosition: SnackPosition.BOTTOM,
// );
} else {
throw Exception('Failed to update status');
}
Expand Down Expand Up @@ -108,21 +108,11 @@ class StatusController extends GetxController {

if (response.statusCode == 201) {
await getStatus(date: selectedDate.value);
Get.snackbar(
'Holiday Added',
'Holiday schedule copied successfully!',
snackPosition: SnackPosition.BOTTOM,
);
} else {
throw Exception('Failed to add Holiday');
}
} catch (e) {
print('Error: $e');
Get.snackbar(
'Error',
'Failed to add Holiday',
snackPosition: SnackPosition.BOTTOM,
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/controllers/timetable/time_table_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ Future<void> getSchedule() async {
print(response.body);
if (response.statusCode == 201) {
await getSchedule();
Get.snackbar("Success", "Schedule has been added for existing course!");
// Get.snackbar("Success", "Schedule has been added for existing course!");
} else {
Get.snackbar("Error", "Failed to add Schedule");
// Get.snackbar("Error", "Failed to add Schedule");
throw Exception('Failed to add schedule');
}
}
Expand Down

0 comments on commit 8c9594a

Please sign in to comment.