This commit is contained in:
Hamza-Ayed
2023-08-16 00:51:19 +03:00
parent 9b3716aabd
commit ceced0735c
2 changed files with 14 additions and 9 deletions

View File

@@ -69,7 +69,7 @@ class RegisterController extends GetxController {
void register() async { void register() async {
if (formKey.currentState!.validate()) { if (formKey.currentState!.validate()) {
await CRUD().post(link: AppLink.signUp, payload: { var res = await CRUD().post(link: AppLink.signUp, payload: {
'first_name': firstNameController.text, 'first_name': firstNameController.text,
'last_name': lastNameController.text, 'last_name': lastNameController.text,
'email': emailController.text, 'email': emailController.text,
@@ -78,13 +78,17 @@ class RegisterController extends GetxController {
'gender': gender, 'gender': gender,
'site': siteController.text, 'site': siteController.text,
'birthdate': birthDate, 'birthdate': birthDate,
}).then((value) => print(value)); });
print(jsonDecode(res));
if (jsonDecode(res)['status'] == 'success') {
print('sdfffffffffff');
int randomNumber = Random().nextInt(100000) + 1;
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
'email': emailController.text,
'token': randomNumber.toString(),
}).then((value) => print(value));
Get.to(() => const VerifyEmailPage());
}
} }
int randomNumber = Random().nextInt(100000) + 1;
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
'email': emailController.text,
'token': randomNumber.toString(),
}).then((value) => print(value));
Get.to(() => const VerifyEmailPage());
} }
} }

View File

@@ -21,7 +21,7 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}', 'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
}, },
); );
// print("--------------" + response.body.toString()); // print("-----/---------" + response.body.toString());
if (response.statusCode == 200) { if (response.statusCode == 200) {
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') { if (jsonData['status'] == 'success') {
@@ -49,6 +49,7 @@ class CRUD {
}, },
); );
print(response.request); print(response.request);
print(payload);
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (response.statusCode == 200) { if (response.statusCode == 200) {
if (jsonData['status'] == 'success') { if (jsonData['status'] == 'success') {