コミット
61b8b79d06
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
新しいイシューから参照