Changeset d76b7ee for resTools_backend/backend/Controllers
- Timestamp:
- 05/12/22 16:36:14 (2 years ago)
- Branches:
- master
- Children:
- cc4db18
- Parents:
- 7a983b0
- Location:
- resTools_backend/backend/Controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
resTools_backend/backend/Controllers/ReservationsController.cs
r7a983b0 rd76b7ee 20 20 } 21 21 22 [Authorize] 23 [HttpGet()] 24 public async Task<List<ReservationResponse>> GetReservations([FromQuery] DateTime from, [FromQuery] DateTime to) 25 { 26 return await _reservationService.GetReservatins(from, to); 27 } 28 22 29 [HttpPost()] 23 30 public async Task<IActionResult> CreateReservation([FromBody] CreateReservationRequest req) -
resTools_backend/backend/Controllers/UsersController.cs
r7a983b0 rd76b7ee 2 2 3 3 using backend.DTOs; 4 using backend.Entities; 4 5 using backend.Helpers; 5 6 using backend.Models; … … 29 30 } 30 31 32 [HttpGet("authed")] 33 public async Task<AuthenticateResponse> IsAuthed() 34 { 35 int userId = 0; 36 try 37 { 38 userId = (int)this.HttpContext.Items["User"]; 39 }catch (Exception ex){ return null; } 40 User user = await _userService.GetById(userId); 41 return new AuthenticateResponse() { Email=user.Email, Id = user.Id}; 42 } 43 31 44 [HttpPost("register")] 32 45 public async Task<AuthenticateResponse> Register(CreateUserRequest req)
Note:
See TracChangeset
for help on using the changeset viewer.