Commit 58b6ec90 authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

update username in table when changing

parent 73fcf475
...@@ -339,6 +339,8 @@ class UsersBloc extends Bloc<UsersEvent, UsersState> { ...@@ -339,6 +339,8 @@ class UsersBloc extends Bloc<UsersEvent, UsersState> {
).then((Response response) { ).then((Response response) {
_log.finer(formatResponse(response)); _log.finer(formatResponse(response));
if (response.statusCode == 205) { if (response.statusCode == 205) {
_users[_users.indexWhere((User user) => user.id == userId)] =
_users[_users.indexWhere((User user) => user.id == userId)].copyWith(name: name);
return; return;
} else { } else {
throw NetworkException('status code other than 205 received', response.statusCode); throw NetworkException('status code other than 205 received', response.statusCode);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment