fix: sync regions

This commit is contained in:
philipp lang 2021-04-10 00:55:43 +02:00
parent 7599641350
commit 6c1eaf4ea5
1 changed files with 3 additions and 3 deletions
app/Initialize

View File

@ -6,7 +6,7 @@ class InitializeRegions {
private $bar;
private $api;
private $nullName = 'Nicht-DE (Ausland)';
private $nullName = 'Nicht-DE';
public function __construct($bar, $api) {
$this->bar = $bar;
@ -15,8 +15,8 @@ class InitializeRegions {
public function handle() {
$this->bar->task('Synchronisiere Bundesländer', function() {
collect($this->api->regions()->data)->each(function($region) {
\App\Region::create(['nami_id' => $region->id, 'name' => $region->descriptor, 'is_null' => $region->descriptor === $this->nullName]);
$this->api->regions()->each(function($region) {
\App\Region::create(['nami_id' => $region->id, 'name' => $region->name, 'is_null' => $region->name == $this->nullName]);
});
});
}