Přidat fail jako chybu
This commit is contained in:
parent
ee6ad69d66
commit
c3333fca95
2 changed files with 3 additions and 3 deletions
|
@ -156,7 +156,7 @@ class Canteen {
|
|||
? "; " + cookies["remember-me"]! + ";"
|
||||
: ";"),
|
||||
});
|
||||
if (r.statusCode != 200) {
|
||||
if (r.statusCode != 200 || r.body.contains("fail")) {
|
||||
return Future.error("Chyba: ${r.body}");
|
||||
}
|
||||
if (r.headers.containsKey("set-cookie")) {
|
||||
|
@ -455,7 +455,7 @@ class Canteen {
|
|||
/// - [bool], `true`, pokud bylo jídlo úspěšně objednáno z burzy, jinak `false`
|
||||
Future<bool> objednatZBurzy(Burza b) async {
|
||||
if (!prihlasen) return Future.error("Uživatel není přihlášen");
|
||||
var res = await _getRequest("/faces/secured/" + b.url!);
|
||||
var res = await _getRequest("/faces/secured/" + b.url!); // TODO: SPRAVIT
|
||||
if (res.contains("Chyba")) return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: canteenlib
|
||||
description: Library for communication with the czech canteen food ordering system iCanteen
|
||||
version: 0.1.0-alpha.14
|
||||
version: 0.1.0-alpha.15
|
||||
repository: 'https://github.com/hernikplays/canteenlib'
|
||||
issue_tracker: 'https://github.com/hernikplays/canteenlib/issues'
|
||||
documentation: 'https://docs.hernikplays.cz'
|
||||
|
|
Reference in a new issue