File tree Expand file tree Collapse file tree 5 files changed +17
-4
lines changed
Expand file tree Collapse file tree 5 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ namespace taskmaster_api.Controllers
77{
88 [ Route ( "api/[controller]" ) ]
99 [ ApiController ]
10+ [ AllowAnonymous ]
1011 public class AuthController : ApplicationControllerBase
1112 {
1213 private readonly IAuthService _authService ;
@@ -17,21 +18,18 @@ public AuthController(IAuthService authService)
1718 }
1819
1920 [ HttpPost ( "login" ) ]
20- [ AllowAnonymous ]
2121 public IActionResult Login ( LoginDto loginDto )
2222 {
2323 return ToHttpResult < LoginResponseDto > ( _authService . Login ( loginDto ) ) ;
2424 }
2525
2626 [ HttpPost ( "register" ) ]
27- [ AllowAnonymous ]
2827 public IActionResult Register ( RegisterDto registerDto )
2928 {
3029 return ToHttpResult < RegisterDto > ( _authService . Register ( registerDto ) ) ;
3130 }
3231
3332 [ HttpPost ( "register-admin" ) ]
34- [ AllowAnonymous ]
3533 public IActionResult RegisterAdmin ( RegisterDto registerDto )
3634 {
3735 return ToHttpResult < RegisterDto > ( _authService . RegisterAdmin ( registerDto ) ) ;
Original file line number Diff line number Diff line change 1- using Microsoft . AspNetCore . Mvc ;
1+ using Microsoft . AspNetCore . Authorization ;
2+ using Microsoft . AspNetCore . Mvc ;
23using taskmaster_api . Data . DTOs ;
4+ using taskmaster_api . Data . Models ;
35using taskmaster_api . Services . Interface ;
46
57namespace taskmaster_api . Controllers
68{
79 [ Route ( "api/[controller]" ) ]
810 [ ApiController ]
11+ [ Authorize ]
912 public class TaskController : ApplicationControllerBase
1013 {
1114 private readonly ITaskService _taskService ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ public class TaskDto : IDto<TaskEntity>
1010 public string Title { get ; set ; }
1111 public string Description { get ; set ; }
1212 public DateTime DueDate { get ; set ; }
13+ public string Status { get ; set ; }
1314
1415 public TaskEntity ToEntity ( )
1516 {
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ public class TaskEntity : IEntity<TaskDto>
1717
1818 public DateTime DueDate { get ; set ; }
1919
20+ public string Status { get ; set ; }
21+
2022 public TaskDto ToDto ( )
2123 {
2224 return EntityHelpers . ToDto < TaskEntity , TaskDto > ( this ) ;
Original file line number Diff line number Diff line change 1+ namespace taskmaster_api . Data . Models
2+ {
3+ public static class TaskStatus
4+ {
5+ public const string Open = "Open" ;
6+ public const string InProgress = "InProgress" ;
7+ public const string Completed = "Complete" ;
8+ }
9+ }
You can’t perform that action at this time.
0 commit comments