fix: [api-explorer] 즐겨찾기 및 태그명 표시 개선
- 즐겨찾기 클릭 시 404 오류 수정 (selectEndpointByPath 함수 추가) - 태그명 형식을 "한글명 (English)"로 변경 - 사용자 목록 조회 오류 수정 (user_tenants 피벗 테이블 사용) - 즐겨찾기 토글 시 페이지 새로고침 없이 로컬 상태 업데이트 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -450,9 +450,22 @@ public function setDefaultEnvironment(int $id): JsonResponse
|
||||
*/
|
||||
public function users(): JsonResponse
|
||||
{
|
||||
$tenantId = auth()->user()->tenant_id;
|
||||
// user_tenants 피벗 테이블에서 기본 테넌트 조회
|
||||
$defaultTenant = \DB::table('user_tenants')
|
||||
->where('user_id', auth()->id())
|
||||
->where('is_default', true)
|
||||
->first();
|
||||
|
||||
$users = \App\Models\User::where('tenant_id', $tenantId)
|
||||
if (!$defaultTenant) {
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
$tenantId = $defaultTenant->tenant_id;
|
||||
|
||||
// 해당 테넌트에 속한 사용자 목록 조회
|
||||
$users = \App\Models\User::whereHas('tenants', function ($query) use ($tenantId) {
|
||||
$query->where('tenant_id', $tenantId);
|
||||
})
|
||||
->select(['id', 'name', 'email'])
|
||||
->orderBy('name')
|
||||
->limit(100)
|
||||
|
||||
Reference in New Issue
Block a user