1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-13 00:28:10 -05:00

improve webfront command error feedback

This commit is contained in:
RaidMax
2022-10-25 14:52:12 -05:00
parent a2ccefd89d
commit 5112d88ce2
4 changed files with 18 additions and 6 deletions

View File

@ -45,10 +45,11 @@ namespace WebfrontCore.Controllers
}
});
}
var server = Manager.GetServers().First(s => s.EndPoint == serverId);
var response = await _remoteCommandService.Execute(Client.ClientId, null, command, Enumerable.Empty<string>(), server);
return !response.Any() ? StatusCode(400, response) : Ok(response);
var (success, response) = await _remoteCommandService.ExecuteWithResult(Client.ClientId, null, command,
Enumerable.Empty<string>(), server);
return success ? Ok(response) : StatusCode(400, response);
}
}
}