This commit is contained in:
2019-12-01 04:13:42 -06:00
parent eef64b414e
commit ddcd082fee
2 changed files with 9 additions and 6 deletions

View File

@@ -58,7 +58,7 @@ class BlacklistController extends Controller
//Get the character id from the universe end point
$charId = $lookup->CharacterNameToId($request->name);
if($charId != -1) {
if($charId != null) {
//Insert the character into the blacklist table
BlacklistUser::insert([
'character_id' => $charId,
@@ -70,7 +70,7 @@ class BlacklistController extends Controller
]);
} else {
//Redirect back to the view
return redirect('/blacklist/display/add')->with('error', $request->name . ' has been biomassed.');
return redirect('/blacklist/display/add')->with('error', $request->name . ' could not be added.');
}
} else {
//Return the view

View File

@@ -92,7 +92,7 @@ class NewLookupHelper {
return $response->characters[0]->id;
} else {
return -1;
return null;
}
}
}
@@ -147,7 +147,7 @@ class NewLookupHelper {
return $response->corporations[0]->id;
} else {
return -1;
return null;
}
}
}
@@ -200,7 +200,7 @@ class NewLookupHelper {
return $response->alliances[0]->id;
} else {
return -1;
return null;
}
}
}
@@ -359,7 +359,10 @@ class NewLookupHelper {
}
private function SaveCharacter($response, $charId) {
$esiHelper = new Esi;
$char = new CharacterLookup;
$char->character_id = $charId;
if(isset($response->alliance_id)) {
$char->alliance_id = $response->alliance_id;
@@ -367,7 +370,7 @@ class NewLookupHelper {
if(isset($response->ancestry_id)) {
$char->ancestry_id = $response->ancestry_id;
}
$char->birthday = $response->birthday;
$char->birthday = $esiHelper->DecodeDate($response->birthday);
$char->bloodline_id = $response->bloodline_id;
$char->corporation_id = $response->corporation_id;
if(isset($response->description)) {