feat: 관리자 페이지 추가 (공지사항, 다운로드, 유저 관리)
- /admin 라우트 추가 (admin 권한 전용) - 공지사항 CRUD, 다운로드 정보 수정, 유저 권한/삭제 관리 - AuthContext에 role 추가 및 localStorage 저장 - 홈 헤더에 admin 링크 표시 (admin만 노출) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
16
src/api/users.js
Normal file
16
src/api/users.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { apiFetch } from './client';
|
||||
|
||||
export function getUsers() {
|
||||
return apiFetch('/api/users');
|
||||
}
|
||||
|
||||
export function updateUserRole(id, role) {
|
||||
return apiFetch(`/api/users/${id}/role`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify({ role }),
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteUser(id) {
|
||||
return apiFetch(`/api/users/${id}`, { method: 'DELETE' });
|
||||
}
|
||||
Reference in New Issue
Block a user