Fix action_type from "created" to" create"

This commit is contained in:
Marcus Moore 2024-10-31 12:19:41 -07:00
parent 4aedbb52fa
commit ae24b73b32
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

View file

@ -52,7 +52,7 @@ class ReportTemplate extends Model
'created_by' => auth()->id(),
]);
$logAction->logaction('created');
$logAction->logaction('create');
});
static::updated(function (ReportTemplate $reportTemplate) {

View file

@ -15,7 +15,10 @@ class ReportTemplateActionLogTransformerTest extends TestCase
{
ReportTemplate::factory()->create();
$actionLogs = Actionlog::whereMorphedTo('item', ReportTemplate::class)->get();
$actionLogs = Actionlog::query()
->whereMorphedTo('item', ReportTemplate::class)
->where('action_type', 'create')
->get();
// should be created when ActionLog is created
$this->assertCount(1, $actionLogs);

View file

@ -20,7 +20,7 @@ class ReportTemplateActivityLoggingTest extends TestCase
$this->assertDatabaseHas('action_logs', [
'created_by' => $user->id,
'action_type' => 'created',
'action_type' => 'create',
'target_id' => null,
'target_type' => null,
'item_type' => ReportTemplate::class,