server creation

This commit is contained in:
Fran Jurmanović
2025-09-18 01:34:16 +02:00
parent b7999b02e8
commit b0ee67c2be
21 changed files with 1542 additions and 82 deletions

View File

@@ -29,3 +29,12 @@ export async function getServiceStatus(token: string, serverId: string): Promise
const response = await fetchServerAPI<ServiceStatus>(`${serverRoute}/${serverId}/service`, token);
return response.data!;
}
export async function createServer(token: string, name: string): Promise<Server> {
const response = await fetchServerAPI<Server>(serverRoute, token, 'POST', { name });
return response.data!;
}
export async function deleteServer(token: string, serverId: string): Promise<void> {
await fetchServerAPI(`${serverRoute}/${serverId}`, token, 'DELETE');
}