Skip to content

Commit 3adbeea

Browse files
RodrigoDevRodrigoDev
authored andcommitted
adjust code
1 parent 5b98347 commit 3adbeea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Api/Controllers/CategoryController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public CategoryController(IServiceProvider provider) : base(provider)
2626
/// </summary>
2727
[Authorize]
2828
[HttpPost]
29-
[SwaggerResponse(StatusCodes.Status200OK, Type = typeof(BaseResponse))]
29+
[SwaggerResponse(StatusCodes.Status201Created, Type = typeof(BaseResponse))]
3030
[SwaggerResponse(StatusCodes.Status400BadRequest, Type = typeof(BaseResponse))]
3131
[SwaggerResponse(StatusCodes.Status500InternalServerError, Type = typeof(BaseResponse))]
3232
public async Task<IActionResult> CreateCategory([FromBody] CreateCategoryCommand command)
@@ -40,7 +40,7 @@ public async Task<IActionResult> CreateCategory([FromBody] CreateCategoryCommand
4040
Success = resp.Success,
4141
Response = null,
4242
ErrorMessage = resp.Message,
43-
Code = resp.Success ? 200 : 400
43+
Code = resp.Success ? 201 : 400
4444
};
4545
}
4646
);

Api/Controllers/TaskController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public TaskController(IServiceProvider provider) : base(provider)
2626
/// </summary>
2727
[Authorize]
2828
[HttpPost]
29-
[SwaggerResponse(StatusCodes.Status200OK, Type = typeof(BaseResponse))]
29+
[SwaggerResponse(StatusCodes.Status201Created, Type = typeof(BaseResponse))]
3030
[SwaggerResponse(StatusCodes.Status400BadRequest, Type = typeof(BaseResponse))]
3131
[SwaggerResponse(StatusCodes.Status500InternalServerError, Type = typeof(BaseResponse))]
3232
public async Task<IActionResult> CreateTask([FromBody] CreateTaskCommand command)
@@ -40,7 +40,7 @@ public async Task<IActionResult> CreateTask([FromBody] CreateTaskCommand command
4040
Success = resp.Success,
4141
Response = null,
4242
ErrorMessage = resp.Message,
43-
Code = resp.Success ? 200 : 400
43+
Code = resp.Success ? 201 : 400
4444
};
4545
}
4646
);

0 commit comments

Comments
 (0)