Merge pull request #303 from nakazawakan/feature/takahashi_0130

updates
このコミットが含まれているのは:
chankan77 2022-01-31 12:57:01 +09:00 committed by GitHub
コミット 61b8b79d06
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 4AEE18F83AFDEB23
3個のファイルの変更6行の追加20行の削除

ファイルの表示

@ -30,6 +30,10 @@ class FatherRelationsController extends Controller {
$father = Father::select('relation_limit')->where('id', $father_id)->first();
if ($father->relation_limit <= FatherRelation::select('id')->where('father_id', $father_id)->count()) {
return ['status_code' => 401, 'error_messages' => ['契約上限数に達した為、メンバー追加できません。']];
}
return ['status_code' => 200];
}
@ -55,7 +59,7 @@ class FatherRelationsController extends Controller {
}
if ($father->relation_limit <= FatherRelation::select('id')->where('father_id', (int)$r->father_id)->count()) {
return ['status_code' => 200, 'success_messages' => ['子の追加に成功しました。'], 'params' => ['child_id' => $child->id, 'limit' => $father->relation_limit]];
return ['status_code' => 401, 'error_messages' => ['契約上限数に達した為、メンバー追加できません。']];
}
$create = [

ファイルの表示

@ -19,25 +19,8 @@ const ChildSignUpTemporary = () => {
useEffect(() => {
isMountedRef.current = false;
setLoaded(false);
setLoaded(true);
if(document.getElementById('father_token')){
let father_id = document.getElementById('father_token').value;
axios.get('/api/children/father/relations/check', {params:{father_id: father_id}})
.then(response=>{
if(isMountedRef.current) return;
if(response.data.status_code == 200){
setLoaded(true);
}
else{
navigator('/c-account/login');
}
})
}
else{
setLoaded(true);
}
return () => {
isMountedRef.current = true;
}

ファイルの表示

@ -168,7 +168,6 @@ Route::group(['prefix' => 'children'], function () {
Route::group(['prefix' => 'father'], function () {
Route::group(['prefix' => 'relations'], function () {
Route::get('/checkNull', '\App\Http\Controllers\Api\FatherRelationsController@checkNull')->name('chknull_child');
Route::get('/check', '\App\Http\Controllers\Api\FatherRelationsController@check')->name('chk_child');
});
});