diff --git a/src/components/CreateServer/CreateServer.jsx b/src/components/CreateServer/CreateServer.jsx index 8f30802..0095d81 100644 --- a/src/components/CreateServer/CreateServer.jsx +++ b/src/components/CreateServer/CreateServer.jsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import styles from './CreateServer.module.scss'; import { getUserSubdomain } from "../../service/firebase"; -import { saveSubdomain } from "../../service/api.tsx"; +import serviiApi from "../../service/api.tsx"; const CreateServer = ({ user, onCreateServer }) => { const [subdomain, setSubdomain] = useState(null); @@ -26,7 +26,7 @@ const CreateServer = ({ user, onCreateServer }) => { const handleSaveSubdomain = async () => { try { - await saveSubdomain(subdomainInput); + await serviiApi.setSubdomain(subdomainInput); setSubdomain(subdomainInput); } catch (error) { console.error('Error setting subdomain:', error); diff --git a/src/pages/DashboardPage/DashboardPage.jsx b/src/pages/DashboardPage/DashboardPage.jsx index 5b843ab..7dcc299 100644 --- a/src/pages/DashboardPage/DashboardPage.jsx +++ b/src/pages/DashboardPage/DashboardPage.jsx @@ -32,8 +32,8 @@ const DashboardPage = ({ user }) => { try { const serverName = prompt('Enter the name for the new server:'); if (!serverName) return; - await createServer(serverName); - loadServers(); + await serviiApi.serverCreate(serverName, "1.20.6", "paper"); + await loadServers(); } catch (error) { console.error('Error creating server:', error); } @@ -41,7 +41,7 @@ const DashboardPage = ({ user }) => { const handleRunServer = async (serverName) => { try { - await runServer(serverName); + await serviiApi.serverRun(serverName); } catch (error) { console.error('Error starting server:', error); } @@ -49,7 +49,7 @@ const DashboardPage = ({ user }) => { const handleStopServer = async (serverName) => { try { - await stopServer(serverName); + await serviiApi.serverStop(serverName); } catch (error) { console.error('Error stopping server:', error); } @@ -57,7 +57,7 @@ const DashboardPage = ({ user }) => { const handleDeleteServer = async (serverName) => { try { - await deleteServer(serverName); + await serviiApi.serverDelete(serverName); loadServers(); } catch (error) { console.error('Error deleting server:', error);