1
0
mirror of https://github.com/bitwarden/server synced 2025-12-16 08:13:33 +00:00

Prefer Repositories for Delete of entities

This commit is contained in:
Matt Gibson
2025-10-09 18:30:13 -07:00
parent 13d666a8b0
commit ec828943a4
3 changed files with 31 additions and 9 deletions

View File

@@ -66,13 +66,13 @@ public class SeedController : Controller
}
[HttpDelete("/seed/{seedId}")]
public IActionResult Delete([FromRoute] Guid seedId)
public async Task<IActionResult> Delete([FromRoute] Guid seedId)
{
_logger.LogInformation("Deleting seeded data with ID: {SeedId}", seedId);
try
{
var result = _recipeService.DestroyRecipe(seedId);
var result = await _recipeService.DestroyRecipe(seedId);
return Ok(new
{
@@ -110,13 +110,13 @@ public class SeedController : Controller
var aggregateException = new AggregateException();
await Task.Run(() =>
await Task.Run(async () =>
{
foreach (var sd in seededData)
{
try
{
_recipeService.DestroyRecipe(sd.Id);
await _recipeService.DestroyRecipe(sd.Id);
}
catch (Exception ex)
{