fix: 회원가입 메뉴 생성 오류 수정 및 검증 에러 처리 개선

주요 변경사항:
- MenusStep.php: 존재하지 않는 컬럼(code, route_name, depth, description) 제거
- MenusStep.php: 실제 DB 스키마 컬럼(hidden, is_external, external_url) 추가
- RecipeRegistry.php: MenusStep 비활성화 (하이브리드 메뉴 생성 방식 도입)
- Handler.php: ValidationException 처리 개선 (실제 에러 메시지 표시, 422 상태 코드)

기술 세부사항:
- 하이브리드 접근: TenantBootstrapper(데이터) + MenuBootstrapService(메뉴)
- HTTP 상태 코드 표준화: 422 Unprocessable Entity (validation 실패)
- 실제 검증 에러 메시지 반환: errors 객체에 필드별 에러 정보 포함
This commit is contained in:
2025-11-10 09:35:43 +09:00
parent 9ba6e8d833
commit 92c60ff39f
4 changed files with 258 additions and 11 deletions

View File

@@ -58,14 +58,22 @@ public function render($request, Throwable $exception)
{
if ($request->expectsJson()) {
// 400 Bad Request (예: ValidationException)
if (
$exception instanceof ValidationException ||
$exception instanceof BadRequestHttpException
) {
// 422 Unprocessable Entity - Validation 실패
if ($exception instanceof ValidationException) {
return response()->json([
'success' => false,
'message' => '필수 파라미터 누락',
'message' => '입력값 검증 실패',
'data' => [
'errors' => $exception->errors(),
],
], 422);
}
// 400 Bad Request
if ($exception instanceof BadRequestHttpException) {
return response()->json([
'success' => false,
'message' => '잘못된 요청',
'data' => null,
], 400);
}