diff --git a/src/components/HotelContext.jsx b/src/components/HotelContext.jsx index 18c29f1..b257652 100644 --- a/src/components/HotelContext.jsx +++ b/src/components/HotelContext.jsx @@ -291,7 +291,29 @@ export function HotelProvider({ accessToken, children, resClientId}) { } - // --- WS USE EFFECT ---- + // --- ADMIN PORTAL ---- + + function registerUser(username,password,hotel_ids, displayname) { + + const payload = { + username, + password, + hotel_ids, + displayname + } + + console.log("Reg") + + const res = fetch(`${API_BASE}/auth/register`, { + method: "PUT", + headers: {"Content-Type": "application/json"}, + body: JSON.stringify(payload), + } + ) + + } + + @@ -372,16 +394,14 @@ export function HotelProvider({ accessToken, children, resClientId}) { users, usersById, clientId, - updateRoomStatus, - fetchMessages, - fetchConvUsers, - sendMessage, + fetchHotelUsers, - addUserToConv, - createConversation, - fetchHotelInventory, - updateItemAmount, - createItem + updateRoomStatus, + fetchMessages, fetchConvUsers, sendMessage, + addUserToConv, createConversation, + fetchHotelInventory, updateItemAmount, createItem, + + registerUser }} > {children} diff --git a/src/components/MainApp.jsx b/src/components/MainApp.jsx index 3f200af..0e0aa7e 100644 --- a/src/components/MainApp.jsx +++ b/src/components/MainApp.jsx @@ -4,6 +4,7 @@ import ChatWidget from "./widget/chatWidget" import InventoryWidget from "./widget/inventoryWidget"; import "./MainApp.css" +import AdminWidget from "./widget/adminWidget"; export default function MainAppWrapper({resClientId}) { const accessToken = localStorage.getItem("access_tokens"); @@ -31,10 +32,11 @@ function MainApp() {