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:
@@ -85,7 +85,7 @@ public class SoundSynthsByMachineController(MarechaiContext context) : Controlle
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<ActionResult<long>> CreateAsync(int soundSynthId, int machineId)
|
||||
public async Task<ActionResult<long>> CreateAsync([FromBody] SoundSynthByMachineDto dto)
|
||||
{
|
||||
string userId = User.FindFirstValue(ClaimTypes.Sid);
|
||||
|
||||
@@ -93,8 +93,8 @@ public class SoundSynthsByMachineController(MarechaiContext context) : Controlle
|
||||
|
||||
var item = new SoundByMachine
|
||||
{
|
||||
SoundSynthId = soundSynthId,
|
||||
MachineId = machineId
|
||||
SoundSynthId = dto.SoundSynthId,
|
||||
MachineId = dto.MachineId
|
||||
};
|
||||
|
||||
await context.SoundByMachine.AddAsync(item);
|
||||
|
||||
Reference in New Issue
Block a user