ch
This commit is contained in:
		
							parent
							
								
									578384c006
								
							
						
					
					
						commit
						fdcc288519
					
				@ -1,7 +1,29 @@
 | 
				
			|||||||
namespace asg_form.Controllers
 | 
					using Microsoft.AspNetCore.Authorization;
 | 
				
			||||||
 | 
					using Microsoft.AspNetCore.Mvc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace asg_form.Controllers
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public class InviteReferee
 | 
					    public class InviteReferee : ControllerBase
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        private readonly RoleManager<Role> roleManager;
 | 
				
			||||||
 | 
					        private readonly UserManager<User> userManager;
 | 
				
			||||||
 | 
					        public InviteReferee(
 | 
				
			||||||
 | 
					            RoleManager<Role> roleManager, UserManager<User> userManager)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            this.roleManager = roleManager;
 | 
				
			||||||
 | 
					            this.userManager = userManager;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    [Route("api/v1/Invite")]
 | 
				
			||||||
 | 
					    [HttpGet]
 | 
				
			||||||
 | 
					    [Authorize]
 | 
				
			||||||
 | 
					    public async Task<ActionResult<object>> GetReferee([FromBody] long Inviteeid)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        string Invitorid = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
 | 
				
			||||||
 | 
					        var user = await userManager.FindByIdAsync(Invitorid);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user