Skip to content

Commit

Permalink
fail earlier if a bad employee_id is given
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Apr 5, 2024
1 parent d360334 commit eff1c2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/frontend/controllers/MethodController.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ public function actionCreate()
}

$userId = User::findOne(['employee_id' => $employeeId])->id ?? null;
if ($userId == null) {
throw new NotFoundHttpException(
'employee_id not found',
1540990165
);
}

return Method::findOrCreate($userId, $value);
}
Expand Down

0 comments on commit eff1c2d

Please sign in to comment.