mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-13 06:11:55 +00:00
changed return
This commit is contained in:
@@ -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();
|
||||||
@@ -97,7 +96,7 @@ inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) =
|
|||||||
|
|
||||||
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) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user