Skip to content

Commit

Permalink
added update and delete in menu repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Nailsonseat committed Feb 17, 2024
1 parent 5d5de50 commit 5c8c971
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions frontend/lib/repositories/mess_menu_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,25 @@ class MessMenuRepository{
}
}

Future<bool> updateMessMenu(String menuId, MessMenu messMenu) async {
try {
final response = await _client.put('/mess-menu/$menuId', data: messMenu.toJson());
_logger.i(response.data);
return true;
} catch (e) {
_logger.e(e);
return false;
}
}

Future<bool> deleteMessMenu(String id) async {
try {
final response = await _client.delete('/mess-menu/$id');
_logger.i(response.data);
return true;
} catch (e) {
_logger.e(e);
return false;
}
}
}

0 comments on commit 5c8c971

Please sign in to comment.