From eef7e44999b6ed53a44b5d092cfbb7167e5cbc4f Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sun, 1 Dec 2024 21:23:22 +0100 Subject: [PATCH] change endpoint --- covas_mobile/lib/pages/DisplayPictureScreen.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/covas_mobile/lib/pages/DisplayPictureScreen.dart b/covas_mobile/lib/pages/DisplayPictureScreen.dart index 32413a6..b50aaa2 100644 --- a/covas_mobile/lib/pages/DisplayPictureScreen.dart +++ b/covas_mobile/lib/pages/DisplayPictureScreen.dart @@ -94,10 +94,12 @@ class DisplayPictureScreenState extends State var name = jsonData["name"]; print("name : ${name}"); var place = jsonData["place"]; + var date = jsonData["start_date"]; var accessToken = prefs.getString("access_token") ?? ""; if (accessToken.isNotEmpty) { - var urlGet = Uri.parse("${globals.api}/events?name=${name}"); + var urlGet = Uri.parse( + "${globals.api}/events/search?item=${name}&date_event=${date}"); var responseGet = await http.get(urlGet, headers: {HttpHeaders.cookieHeader: 'access_token=${accessToken}'}); @@ -116,6 +118,9 @@ class DisplayPictureScreenState extends State MaterialPageRoute( builder: (_) => ItemMenu(title: events[0]["id"]))); } + } else { + showErrorDialog(context, + "response status code update : ${responseGet.statusCode}"); } } else { showErrorDialog(context, "Erreur de token");