Skip to content

Commit fe994a4

Browse files
authored
🐛 only report user trips (#3470)
1 parent b35c786 commit fe994a4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app/Observers/TripObserver.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
namespace App\Observers;
44

55
use App\Enum\Report\ReportableSubject;
6-
use App\Enum\Report\ReportReason;
6+
use App\Enum\TripSource;
77
use App\Models\Trip;
8-
use App\Repositories\ReportRepository;
98
use App\Services\ReportService;
10-
use Illuminate\Support\Facades\Log;
119

1210
class TripObserver
1311
{
1412
public function created(Trip $trip): void {
1513
// check if trip is out of allowed types and create an admin report if so
16-
(new ReportService())->checkAndReport(
17-
$trip->linename,
18-
ReportableSubject::TRIP,
19-
$trip->id
20-
);
14+
if ($trip->source === TripSource::USER) {
15+
(new ReportService())->checkAndReport(
16+
$trip->linename,
17+
ReportableSubject::TRIP,
18+
$trip->id
19+
);
20+
}
2121
}
2222
}

0 commit comments

Comments
 (0)