fix: [inspection] 완료된 검사 수정 차단
- InspectionService.update()에 완료 상태 검증 추가 - 완료된 검사 수정 시 400 에러 반환 - error.php에 cannot_modify_completed 메시지 추가
This commit is contained in:
@@ -218,6 +218,10 @@ public function update(int $id, array $data)
|
||||
throw new NotFoundHttpException(__('error.not_found'));
|
||||
}
|
||||
|
||||
if ($inspection->status === Inspection::STATUS_COMPLETED) {
|
||||
throw new BadRequestHttpException(__('error.inspection.cannot_modify_completed'));
|
||||
}
|
||||
|
||||
$beforeData = $inspection->toArray();
|
||||
|
||||
return DB::transaction(function () use ($inspection, $data, $userId, $beforeData) {
|
||||
|
||||
@@ -456,6 +456,7 @@
|
||||
'inspection' => [
|
||||
'not_found' => '검사를 찾을 수 없습니다.',
|
||||
'cannot_delete_completed' => '완료된 검사는 삭제할 수 없습니다.',
|
||||
'cannot_modify_completed' => '완료된 검사는 수정할 수 없습니다.',
|
||||
'already_completed' => '이미 완료된 검사입니다.',
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user