Merge branch 'backend' of https://github.com/nakazawakan/kikikanri into p_account

このコミットが含まれているのは:
dragon1211 2021-11-17 02:13:23 -08:00
コミット 728ca31330
1個のファイルの変更16行の追加0行の削除

ファイルの表示

@ -14,6 +14,14 @@ class FatherRelationsController extends Controller {
return ['status_code' => 400, 'error_messages' => ['子の追加に失敗しました。']];
}
$validate = Validator::make($r->all(), [
'identity' => 'required|max:20|alpha_num',
]);
if ($validate->fails()) {
return ['status_code' => 422, 'error_messages' => $validate->errors()];
}
if (null === ($child = Child::select('id')->where('identity', $r->identity)->first())) {
return ['status_code' => 400, 'error_messages' => ['子の追加に失敗しました。']];
}
@ -43,6 +51,14 @@ class FatherRelationsController extends Controller {
return ['status_code' => 400, 'error_messages' => ['子の入社日の更新に失敗しました。']];
}
$validate = Validator::make($r->all(), [
'hire_at' => 'date',
]);
if ($validate->fails()) {
return ['status_code' => 422, 'error_messages' => $validate->errors()];
}
$update = [
'hire_at' => date('Y-m-d H:i:s', strtotime($r->hire_at)),
];