mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Refactor controllers to use [FromBody] attribute for DTO parameters and update return types for consistency
This commit is contained in:
@@ -97,7 +97,7 @@ public class ResolutionsByScreenController(MarechaiContext context) : Controller
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<ActionResult<long>> CreateAsync(int resolutionId, int screenId)
|
||||
public async Task<ActionResult<long>> CreateAsync([FromBody] ResolutionByScreenDto dto)
|
||||
{
|
||||
string userId = User.FindFirstValue(ClaimTypes.Sid);
|
||||
|
||||
@@ -105,8 +105,8 @@ public class ResolutionsByScreenController(MarechaiContext context) : Controller
|
||||
|
||||
var item = new ResolutionsByScreen
|
||||
{
|
||||
ScreenId = screenId,
|
||||
ResolutionId = resolutionId
|
||||
ScreenId = dto.ScreenId,
|
||||
ResolutionId = dto.ResolutionId
|
||||
};
|
||||
|
||||
await context.ResolutionsByScreen.AddAsync(item);
|
||||
|
||||
Reference in New Issue
Block a user