Skip to content

Commit

Permalink
Merge pull request #880 from owlchester/api-tests-failing-scout
Browse files Browse the repository at this point in the history
Fixed issues with the API and API Tests
  • Loading branch information
ilestis authored May 22, 2024
2 parents c2e4385 + 166e9a3 commit 094eccb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/Api/v1/AbilityApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function store(Request $request, Campaign $campaign)
$data['campaign_id'] = $campaign->id;
$model = Ability::create($data);
$this->crudSave($model);

return new Resource($model);
}

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Api/v1/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ protected function crudSave(MiscModel $model)
$model->entity->touch();
}
}
$model->refresh();
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/v1/BookmarkApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function store(Request $request, Campaign $campaign)
/** @var Bookmark $model */
$model = Bookmark::create($data);
$this->crudSave($model);
$model->refresh();

return new Resource($model);
}

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Api/v1/CalendarApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function store(Request $request, Campaign $campaign)
/** @var Calendar $model */
$model = Calendar::create($data);
$this->crudSave($model);

return new Resource($model);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/v1/CreatureApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function store(Request $request, Campaign $campaign)
$data['campaign_id'] = $campaign->id;
$model = Creature::create($data);
$this->crudSave($model);
$model->refresh();

return new Resource($model);
}

Expand Down
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
<env name="DB_DATABASE" value=":memory:" />
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="MAIL_MAILER" value="array"/>
<env name="SCOUT_DRIVER" value="null"/>
</php>
</phpunit>

0 comments on commit 094eccb

Please sign in to comment.