feat: translation codes
CI / 🧪 Tests Laravel (push) Successful in 2m34s
CI / 🐳 Build & Push Images (push) Successful in 2m26s

This commit is contained in:
2026-08-14 12:46:29 +02:00
parent 69372a49ed
commit 8b60283eeb
28 changed files with 59 additions and 62 deletions
+5 -5
View File
@@ -35,7 +35,7 @@ class ModerationReportService
->where('reportable_id', $reportable->getKey())
->exists(),
409,
__('api.reports.already_exists'),
'REPORT_ALREADY_EXISTS',
);
$report = Report::create([
@@ -62,7 +62,7 @@ class ModerationReportService
});
} catch (QueryException $exception) {
if ($this->isDuplicateReportException($exception)) {
abort(409, __('api.reports.already_exists'));
abort(409, 'REPORT_ALREADY_EXISTS');
}
throw $exception;
@@ -128,19 +128,19 @@ class ModerationReportService
abort_if(
$reportable instanceof User && $reportable->is($reporter),
422,
__('api.reports.cannot_report_self'),
'CANNOT_REPORT_SELF',
);
abort_if(
$reportable instanceof MealPosts && $reportable->user_id === $reporter->getKey(),
422,
__('api.reports.cannot_report_own_meal'),
'CANNOT_REPORT_OWN_MEAL',
);
abort_if(
$reportable instanceof PostReviews && $reportable->user_id === $reporter->getKey(),
422,
__('api.reports.cannot_report_own_review'),
'CANNOT_REPORT_OWN_REVIEW',
);
}