최고관리자가 부여한 권한에 따라 메뉴 보여주기

This commit is contained in:
kjs
2025-10-27 18:27:32 +09:00
parent 15776e76f5
commit 821336d40d
8 changed files with 2265 additions and 30 deletions

View File

@@ -56,7 +56,9 @@ function getAuthToken(): string | null {
// 인증 헤더 생성 헬퍼
function getAuthHeaders(): HeadersInit {
const token = getAuthToken();
const headers: HeadersInit = {};
const headers: HeadersInit = {
"Content-Type": "application/json",
};
if (token) {
headers["Authorization"] = `Bearer ${token}`;
}
@@ -406,12 +408,9 @@ export async function getAllStepCounts(flowId: number): Promise<ApiResponse<Flow
*/
export async function moveData(data: MoveDataRequest): Promise<ApiResponse<{ success: boolean }>> {
try {
const token = getAuthToken();
const response = await fetch(`${API_BASE}/flow/move`, {
method: "POST",
headers: getAuthHeaders(),
...(token && { Authorization: `Bearer ${token}` }),
headers: getAuthHeaders(),
credentials: "include",
body: JSON.stringify(data),
});
@@ -447,12 +446,9 @@ export async function moveBatchData(
data: MoveBatchDataRequest,
): Promise<ApiResponse<{ success: boolean; results: any[] }>> {
try {
const token = getAuthToken();
const response = await fetch(`${API_BASE}/flow/move-batch`, {
method: "POST",
headers: getAuthHeaders(),
...(token && { Authorization: `Bearer ${token}` }),
headers: getAuthHeaders(),
credentials: "include",
body: JSON.stringify(data),
});