changed return

This commit is contained in:
2025-01-29 20:03:49 -06:00
parent 4c844a8051
commit 73d58aea4f
+2 -3
View File
@@ -84,7 +84,6 @@ inventoryGroup.MapPut("/{id}", async (int id, InventoryItems updatedItem, BarkCo
return Results.Ok(existingItem); return Results.Ok(existingItem);
}); });
inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) => inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) =>
{ {
var newItem = new InventoryItems(); var newItem = new InventoryItems();
@@ -94,10 +93,10 @@ inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) =
newItem.RentalPrice = newItemInput.RentalPrice; newItem.RentalPrice = newItemInput.RentalPrice;
newItem.ReplacementCost = newItemInput.ReplacementCost; newItem.ReplacementCost = newItemInput.ReplacementCost;
newItem.StatusId = "ready"; newItem.StatusId = "ready";
db.Inventory.Add(newItem); db.Inventory.Add(newItem);
await db.SaveChangesAsync(); await db.SaveChangesAsync();
return Results.Created($"/inventory/{newItemInput.Id}", newItemInput); return Results.Created($"/inventory/{newItem.Id}", newItem);
}); });
inventoryGroup.MapDelete("/{id}", async (int id, BarkContext db) => inventoryGroup.MapDelete("/{id}", async (int id, BarkContext db) =>