「親のrel_limが0の際、画面を遷移するだけで「失敗しました」とアラートが出てしまいます。」
このコミットが含まれているのは:
コミット
7aa379836c
|
@ -15,6 +15,14 @@ use App\Models\Meeting;
|
|||
use App\Models\MeetingApprovals;
|
||||
|
||||
class FatherRelationsController extends Controller {
|
||||
public function check () {
|
||||
if (FatherRelation::select('id')->where('father_id', (int)session()->get('fathers')['id'])->count() == 0) {
|
||||
return ['status_code' => 401, 'error_messages' => ['契約上限数に達した為、メンバー追加できません。']];
|
||||
}
|
||||
|
||||
return ['status_code' => 200];
|
||||
}
|
||||
|
||||
public function register (Request $r) {
|
||||
if (!isset($r->father_id)) {
|
||||
return ['status_code' => 400, 'error_messages' => ['子の追加に失敗しました。']];
|
||||
|
|
|
@ -133,6 +133,7 @@ Route::group(['prefix' => 'fathers'], function () {
|
|||
|
||||
// FatherRelationsController
|
||||
Route::group(['prefix' => 'relations'], function () {
|
||||
Route::get('/check', '\App\Http\Controllers\Api\FatherRelationsController@check');
|
||||
Route::post('/register', '\App\Http\Controllers\Api\FatherRelationsController@register');
|
||||
Route::put('/updateHireDate/{child_id}', '\App\Http\Controllers\Api\FatherRelationsController@updateHireDate');
|
||||
Route::delete('/deleteRelationChild/{child_id}', '\App\Http\Controllers\Api\FatherRelationsController@deleteRelationChild');
|
||||
|
|
新しいイシューから参照