CorporateEmpReg method
Future
CorporateEmpReg(
{ - dynamic empId,
- dynamic corporatecode,
- dynamic context,
})
Implementation
Future CorporateEmpReg({empId, corporatecode, context}) async {
final response = await http.post(
Uri.parse('${SDK_BASE_URL}claim_adminpanel/claim_api/corporate_register'),
body: {
"employee_id": empId,
"official_email": corporatecode,
},
);
var decodedResponse = json.decode(response.body);
if (decodedResponse['status'] == true) {
Get.to(CorporateCreateAccount(corpId: CorId.toString()));
CorCropoName = decodedResponse['data']['corporate_name'];
CorFullName = decodedResponse['data']['fullname'];
CorId = decodedResponse['data']['id'];
} else {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(
"${decodedResponse['message']}".trim(),
style: TextStyle(
fontFamily: 'Nunito', fontWeight: FontWeight.w500, fontSize: 14),
)));
}
}