From c1352b8eeb0b8da48baf87ca17f615fbab8012ae Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Fri, 14 Feb 2025 21:19:44 +0100 Subject: [PATCH] add profil ok --- covas_mobile/lib/pages/AddProfile.dart | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/covas_mobile/lib/pages/AddProfile.dart b/covas_mobile/lib/pages/AddProfile.dart index 7dbb7e6..96d374b 100644 --- a/covas_mobile/lib/pages/AddProfile.dart +++ b/covas_mobile/lib/pages/AddProfile.dart @@ -44,12 +44,10 @@ class _AddProfileState extends State with ShowAlertDialog { TextEditingController inputPasswordConfirmed = TextEditingController(); onTapFunctionDatePicker({required BuildContext context}) async { - DateTime initialDate = DateTime.parse(formatDate(inputBirth.text)); - DateTime? pickedDate = await showDatePicker( context: context, firstDate: DateTime(1900), - initialDate: initialDate, + initialDate: DateTime.now(), lastDate: DateTime(2104)); if (pickedDate == null) return; inputBirth.text = DateFormat("dd/MM/yyyy").format(pickedDate); @@ -95,7 +93,7 @@ class _AddProfileState extends State with ShowAlertDialog { } } - var urlPut = Uri.parse("${globals.api}/users"); + var urlPut = Uri.parse("${globals.api}/mail"); var responsePost = await http.post(urlPut, headers: { @@ -108,12 +106,11 @@ class _AddProfileState extends State with ShowAlertDialog { 'firstName': firstName, 'password': password, 'email': email, - 'roles': '', 'birth': birth.toString() })); print(responsePost.statusCode); if (responsePost.statusCode == 200) { - showAlertDialog(context, "Ajout", "Votre utilisateur a été ajouté"); + showAlertDialog(context, "Creation", "Votre utilisateur a été créé"); Navigator.pushReplacement( context, MaterialPageRoute(builder: (_) => LoginDemo())); return;