fix : 테넌트 없는 회원 처리 및 테넌트 등록시 해당 테넌트 디폴트값 설정

This commit is contained in:
2025-08-14 20:19:51 +09:00
parent e9d1e42359
commit 9935bba84e
4 changed files with 37 additions and 21 deletions

View File

@@ -257,6 +257,16 @@ public static function storeTenants(array $params = [])
$tenant = Tenant::create($payload);
// 성성된 테넌트를 나의 테넌트로 셋팅
$apiUser = app('api_user');
UserTenant::create([
'user_id' => $apiUser,
'tenant_id' => $tenant->id,
'is_active' => 0,
'is_default' => 1,
'joined_at' => now(),
]);
// 생성된 리소스를 그대로 반환 (목록 카드용 요약 원하면 컬럼 제한)
return ApiResponse::response('result', $tenant);
}