feat: translation codes
This commit is contained in:
@@ -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',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user