Legend:
- Unmodified
- Added
- Removed
-
resTools_backend/backend/Controllers/UsersController.cs
r49b0bbd r13f1472 39 39 { 40 40 userId = (int)this.HttpContext.Items["User"]; 41 }catch (Exception ex){ return null; } 41 } 42 catch (Exception ex) 43 { 44 var usr = await _userService.GetByEmail((string)this.HttpContext.Items["User"]); 45 if(usr == null) 46 { 47 return null; 48 } 49 userId = usr.Id; 50 } 42 51 User user = await _userService.GetById(userId); 43 return new AuthenticateResponse() { Email=user.Email, Id = user.Id, IsAdmin = user.IsAdmin, IsConfirmed = user.IsConfirmed };52 return new AuthenticateResponse() { Email=user.Email, Id = user.Id, IsAdmin = user.IsAdmin, IsConfirmed = user.IsConfirmed, isVip = user.IsVip}; 44 53 } 45 54 … … 93 102 return response; 94 103 } 104 105 [Authorize] 106 [HttpGet()] 107 public async Task<List<UserResponse>> GetUsers() 108 { 109 return await _userService.GetUsers(); 110 } 111 112 [Authorize] 113 [HttpPost("{id}/vip")] 114 public async Task UpdateVip(int id, bool newStatus) 115 { 116 await _userService.UpdateVipStatus(id,newStatus); 117 } 95 118 }
Note:
See TracChangeset
for help on using the changeset viewer.