mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-18 05:50:31 +00:00
[~] Fix : added server state update at /serverStop
Signed-off-by: Charles Le Maux <charles.le-maux@epitech.eu>
This commit is contained in:
parent
156d95c1cb
commit
6b9df8e668
@ -100,7 +100,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function sendRequest(endpoint, payload) {
|
function sendRequest(endpoint, payload) {
|
||||||
return fetch(`https://176.165.62.226:3000/${endpoint}`, {
|
return fetch(`http://176.165.62.226:3000/${endpoint}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
@ -155,6 +155,7 @@ def server_stop(user: UserRecord, name: str) -> tuple[HTTPStatus, str or None]:
|
|||||||
return HTTPStatus.NOT_FOUND, f"Server {name} not found in firestore."
|
return HTTPStatus.NOT_FOUND, f"Server {name} not found in firestore."
|
||||||
exists: bool = mc_manager.stop_server(port)
|
exists: bool = mc_manager.stop_server(port)
|
||||||
if exists:
|
if exists:
|
||||||
|
firebase_manager.update_server_running_state(user.uid, name, False)
|
||||||
return HTTPStatus.OK, f"Successfully stopped server {name}."
|
return HTTPStatus.OK, f"Successfully stopped server {name}."
|
||||||
return HTTPStatus.OK, f"Server {name} already stopped."
|
return HTTPStatus.OK, f"Server {name} already stopped."
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user