diff --git a/src/components/HotelContext.jsx b/src/components/HotelContext.jsx index 4ab9622..c559ba2 100644 --- a/src/components/HotelContext.jsx +++ b/src/components/HotelContext.jsx @@ -190,7 +190,15 @@ export function HotelProvider({ accessToken, children, resClientId}) { } + async function updateItemAmount(item_id, item_amount) { + const res = await fetch ( `${API_BASE}/inventory/update_item/${item_id}/${item_amount}`, + { + method: "PUT", + headers: { Authorization: `Bearer ${accessTokenSingle}` } + }); + + } async function fetchHotelUsers() { const res = await fetch(`${API_BASE}/chat/hotel_users`, { @@ -252,7 +260,8 @@ export function HotelProvider({ accessToken, children, resClientId}) { fetchHotelUsers, addUserToConv, createConversation, - fetchHotelInventory + fetchHotelInventory, + updateItemAmount }} > {children} diff --git a/src/components/widget/inventoryWidget.jsx b/src/components/widget/inventoryWidget.jsx index 9164a95..3d40ac3 100644 --- a/src/components/widget/inventoryWidget.jsx +++ b/src/components/widget/inventoryWidget.jsx @@ -23,10 +23,54 @@ export default function InventoryWidget({}) { return ( -
setEditing(true)} /*style={ cursor: "pointer" }*/>Amount :{amount}
+ ):( +