From c3333fca95bcffba8333c1834f434d8b84d217fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Sat, 9 Apr 2022 17:52:54 +0200 Subject: [PATCH] =?UTF-8?q?P=C5=99idat=20fail=20jako=20chybu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/canteen.dart | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/canteen.dart b/lib/src/canteen.dart index c5e72d5..eb0af4a 100644 --- a/lib/src/canteen.dart +++ b/lib/src/canteen.dart @@ -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 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; } diff --git a/pubspec.yaml b/pubspec.yaml index 219c2fd..35f3df5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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'