mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-12 22:11:54 +00:00
back end changes
This commit is contained in:
+10
-2
@@ -85,11 +85,19 @@ inventoryGroup.MapPut("/{id}", async (int id, InventoryItems updatedItem, BarkCo
|
||||
});
|
||||
|
||||
|
||||
inventoryGroup.MapPost("", async (InventoryItems newItem, BarkContext db) =>
|
||||
inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) =>
|
||||
{
|
||||
var newItem = new InventoryItems();
|
||||
newItemInput.Name = newItem.Name;
|
||||
newItem.Brand = newItemInput.Brand;
|
||||
newItem.SerialNumber = newItemInput.SerialNumber;
|
||||
newItem.RentalPrice = newItemInput.RentalPrice;
|
||||
newItem.ReplacementCost = newItemInput.ReplacementCost;
|
||||
newItem.StatusId = "ready";
|
||||
|
||||
db.Inventory.Add(newItem);
|
||||
await db.SaveChangesAsync();
|
||||
return Results.Created($"/inventory/{newItem.Id}", newItem);
|
||||
return Results.Created($"/inventory/{newItemInput.Id}", newItemInput);
|
||||
});
|
||||
|
||||
inventoryGroup.MapDelete("/{id}", async (int id, BarkContext db) =>
|
||||
|
||||
+4
-1
@@ -1 +1,4 @@
|
||||
VITE_API_URL=https://barkdev.ts.drewr.io
|
||||
#Staging API
|
||||
VITE_API_URL=https://barkdev.ts.drewr.io
|
||||
#Local Dev API
|
||||
#VITE_API_URL=http://localhost:5145
|
||||
Reference in New Issue
Block a user