mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-12 22:11:54 +00:00
fixed stupid, also page redirect
This commit is contained in:
@@ -87,7 +87,7 @@ inventoryGroup.MapPut("/{id}", async (int id, InventoryItems updatedItem, BarkCo
|
||||
inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) =>
|
||||
{
|
||||
var newItem = new InventoryItems();
|
||||
newItemInput.Name = newItem.Name;
|
||||
newItem.Name = newItemInput.Name;
|
||||
newItem.Brand = newItemInput.Brand;
|
||||
newItem.SerialNumber = newItemInput.SerialNumber;
|
||||
newItem.RentalPrice = newItemInput.RentalPrice;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#Staging API
|
||||
VITE_API_URL=https://barkdev.ts.drewr.io
|
||||
#VITE_API_URL=https://barkdev.ts.drewr.io
|
||||
#Local Dev API
|
||||
#VITE_API_URL=http://localhost:5145
|
||||
VITE_API_URL=http://localhost:5145
|
||||
@@ -2,9 +2,12 @@ import {Button, Group, TextInput, NumberInput, Container, Title, Flex} from '@ma
|
||||
import {useForm} from '@mantine/form';
|
||||
import {useMutation} from "@tanstack/react-query";
|
||||
import {NewItem} from "./types.ts";
|
||||
import { useNavigate} from "react-router";
|
||||
|
||||
function AddItem() {
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const newItemForm = useForm<NewItem>({
|
||||
mode: 'uncontrolled',
|
||||
initialValues: {
|
||||
@@ -29,6 +32,10 @@ function AddItem() {
|
||||
}
|
||||
});
|
||||
|
||||
if (result.ok) {
|
||||
navigate("/inventory");
|
||||
}
|
||||
|
||||
if (!result.ok) {
|
||||
throw new Error('Failed to update inventory item');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user