권한설정 페이지 수정/student만
This commit is contained in:
@@ -22,17 +22,22 @@ export async function getInstructors(): Promise<UserRow[]> {
|
||||
?.split('=')[1])
|
||||
: null;
|
||||
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL
|
||||
? `${process.env.NEXT_PUBLIC_API_BASE_URL}/admin/users/compact`
|
||||
: 'https://hrdi.coconutmeet.net/admin/users/compact';
|
||||
|
||||
// 쿼리 파라미터 추가: type=STUDENT, limit=10
|
||||
const apiUrl = new URL(baseUrl);
|
||||
apiUrl.searchParams.set('type', 'STUDENT');
|
||||
apiUrl.searchParams.set('limit', '10');
|
||||
|
||||
console.log('🔍 [getInstructors] API 호출 정보:', {
|
||||
url: apiUrl,
|
||||
url: apiUrl.toString(),
|
||||
hasToken: !!token,
|
||||
tokenLength: token?.length || 0
|
||||
});
|
||||
|
||||
const response = await fetch(apiUrl, {
|
||||
const response = await fetch(apiUrl.toString(), {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -51,11 +51,17 @@ export default function AdminIdPage() {
|
||||
?.split('=')[1];
|
||||
|
||||
// 외부 API 호출
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL
|
||||
? `${process.env.NEXT_PUBLIC_API_BASE_URL}/admin/users/compact`
|
||||
: 'https://hrdi.coconutmeet.net/admin/users/compact';
|
||||
|
||||
const response = await fetch(apiUrl, {
|
||||
// 쿼리 파라미터 추가: type=STUDENT, limit=10, page=currentPage
|
||||
const apiUrl = new URL(baseUrl);
|
||||
apiUrl.searchParams.set('type', 'STUDENT');
|
||||
apiUrl.searchParams.set('limit', '10');
|
||||
apiUrl.searchParams.set('page', String(currentPage));
|
||||
|
||||
const response = await fetch(apiUrl.toString(), {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -137,7 +143,7 @@ export default function AdminIdPage() {
|
||||
}
|
||||
|
||||
fetchUsers();
|
||||
}, []);
|
||||
}, [currentPage]);
|
||||
|
||||
const filteredUsers = useMemo(() => {
|
||||
return activeTab === 'all'
|
||||
@@ -414,7 +420,7 @@ export default function AdminIdPage() {
|
||||
</h1>
|
||||
</div>
|
||||
{/* 탭 네비게이션 */}
|
||||
<div>
|
||||
{/* <div>
|
||||
<div className="flex items-center gap-8 border-b border-input-border">
|
||||
{[
|
||||
{ id: 'all' as TabType, label: '전체' },
|
||||
@@ -440,7 +446,7 @@ export default function AdminIdPage() {
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
{/* 콘텐츠 영역 */}
|
||||
<div className="flex-1 pt-8 flex flex-col">
|
||||
|
||||
Reference in New Issue
Block a user