Fixed adding server

This commit is contained in:
Shobhit Pathak 2023-09-28 13:08:27 +05:30
parent 18de41ceb4
commit 8c53f61381

View File

@ -132,20 +132,20 @@
e.preventDefault(); // Prevent the default form submission e.preventDefault(); // Prevent the default form submission
// Get input values // Get input values
const serverIP = $('#serverIP').val(); const server_ip = $('#serverIP').val();
const serverPort = $('#serverPort').val(); const server_port = $('#serverPort').val();
const rconPassword = $('#rconPassword').val(); const rcon_password = $('#rconPassword').val();
if (!serverIP || !serverPort || !rconPassword) { if (!server_ip || !server_port || !rcon_password) {
alert('All fields are required.'); alert('All fields are required.');
return; // Do not proceed with the request return; // Do not proceed with the request
} }
// Create server data object // Create server data object
const serverData = { const serverData = {
serverIP, server_ip,
serverPort, server_port,
rconPassword, rcon_password,
}; };
// Make an API POST request to add the server // Make an API POST request to add the server