최고관리자가 부여한 권한에 따라 메뉴 보여주기
This commit is contained in:
@@ -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),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user