示例#1
0
        public async Task <IActionResult> AssignLead([FromBody] AssignLeadViewModel assignLeadViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (await _userService.AssignLeadAsync(assignLeadViewModel))
            {
                return(Ok());
            }

            return(BadRequest(string.Format(_errorLocalizer["FailedRoleUpdate"].Value, RoleTypes.InitiativeLead)));
        }
 public async Task <bool> AssignLeadAsync(AssignLeadViewModel assignLeadViewModel)
 {
     return(await _userRepository.AssignLeadAsync(assignLeadViewModel.initiativeId, assignLeadViewModel.userId));
 }