body for esi

This commit is contained in:
2018-11-13 22:18:44 -06:00
parent 73ff0e8fe7
commit 4407b70ecb
2 changed files with 3 additions and 3 deletions

View File

@@ -100,7 +100,7 @@ class FleetsController extends Controller
//Retrieve the fleet data
$fleet = DB::table('Fleets')->where('fleet', $fleetId)->get();
//Add a pilot to the fleet
$error = $newPilot->AddPilot($fleet[0]->character_id, $charId);
$error = $newPilot->AddPilot($fleet[0]->character_id, $charId, $fleetId);
if($error) {
return view('fleets.displayfleets')->with($error)->with('data', null);
} else {

View File

@@ -84,7 +84,7 @@ class Fleet {
return $error;
}
public function AddPilot($fc, $charId) {
public function AddPilot($fc, $charId, $fleetId) {
//Check if the fc has the right scope
if(!$this->HaveEsiScope($fc, 'esi-fleets.write_fleet.v1')) {
return 1;
@@ -104,7 +104,7 @@ class Fleet {
$esi->setBody(['character_id' => $charId, 'role' => 'squad_member']);
//Perform the call to ESI
$error = $esi->invoke('post', '/fleets/{fleet_id}/members/', [
'fleet_id' => $this->fleet,
'fleet_id' => $fleetId,
]);
return $error;