location.dart update

remotes/origin/database-api-implementation
Dorian HODIN 2 years ago committed by felixmielcarek
parent 3b2be5a2da
commit fc355a52c2

@ -38,11 +38,11 @@ class Location {
var data = jsonDecode(response.body); var data = jsonDecode(response.body);
if (data.runtimeType==String) { if (data.runtimeType==String) {
if (data=="Failed to connect to MySQL, connection timeout"){ if (data=="Failed to connect to MySQL, connection timeout"){
return Future.error("Failed to connect to MySQL, connection timeout"); return Future.error(data);
}else if (data=="The POST didn't return any values"){ }else if (data=="The POST didn't return any values"){
return Future.error("POST method failed"); return Future.error(data);
}else{ }else{
return Future.error("Can't find current user in the database"); return Future.error(data); //ERROR No user found in the database
} }
}else { }else {
data.forEach((s) => spot.putIfAbsent(s['user'], () => s['music'])); data.forEach((s) => spot.putIfAbsent(s['user'], () => s['music']));

Loading…
Cancel
Save