Adding consume property to create/update spawnable dtos

This commit is contained in:
hz
2025-06-09 19:07:48 -05:00
parent 83030c2a4e
commit 603a18e006
5 changed files with 16 additions and 6 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ public class PlayerController : ControllerBase
}
[HttpPut]
[Authorize(Roles = "SUPER")]
[Authorize(Roles = "USER,SUPER")]
public async Task<IActionResult> Update([FromBody] UpdatePlayerRequest req)
{
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
@@ -109,7 +109,7 @@ public class PlayerController : ControllerBase
}
[HttpDelete]
[Authorize(Roles = "SUPER")]
[Authorize(Roles = "USER,SUPER")]
public async Task<IActionResult> Delete()
{
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
+3 -1
View File
@@ -26,7 +26,8 @@ public class SpawnableController : ControllerBase
Name = req.Name.ToLower(),
SpawnRate = req.SpawnRate,
CollectAction = req.CollectAction,
CollectResults = req.CollectResults
CollectResults = req.CollectResults,
ConsumeOnSuccess = req.ConsumeOnSuccess
};
await _spawnableService.CreateAsync(spawnable);
@@ -45,6 +46,7 @@ public class SpawnableController : ControllerBase
spawnable.SpawnRate = req.SpawnRate;
spawnable.CollectAction = req.CollectAction;
spawnable.CollectResults = req.CollectResults;
spawnable.ConsumeOnSuccess = req.ConsumeOnSuccess;
await _spawnableService.UpdateAsync(spawnable);
return Ok(spawnable);