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;