- Biome 설정 파일 마이그레이션 및 규칙 적용 │

│    - 전체 파일 대상 포맷팅 및 린트 오류 수정                                             │
 │    -  타입을 으로 변경하여 타입 안정성 강화                                │
 │    - 불필요한 import 제거 및 useEffect 의존성 배열 수정                                  │
 │    -  파일을 /로 마이그레이션하여 타입스크립트 일관성 확보               │
 │    - 에 개발 원칙 추가
This commit is contained in:
Lectom C Han
2025-08-02 18:51:22 +09:00
parent 211689e889
commit 8db8ce668c
86 changed files with 3434 additions and 1767 deletions

View File

@@ -3,10 +3,17 @@ import { handleApiError } from "./error";
// --- 타입 정의 ---
interface ApiField {
key: string;
name: string;
format: "text" | "textarea" | "number" | "select";
status: string;
}
export interface Feedback {
id: string;
content: string;
[key: string]: any; // 동적 필드를 위해 인덱스 시그니처 사용
[key: string]: unknown; // 동적 필드를 위해 인덱스 시그니처 사용
}
export interface Issue {
@@ -25,7 +32,7 @@ export interface FeedbackField {
// 피드백 생성 요청 타입 (동적 데이터 포함)
export interface CreateFeedbackRequest {
issueNames: string[];
[key: string]: any; // 폼 데이터 필드 (예: { message: "...", rating: 5 })
[key: string]: unknown; // 폼 데이터 필드 (예: { message: "...", rating: 5 })
}
// --- API 함수 ---
@@ -72,7 +79,10 @@ export const getFeedbackFields = async (
const url = getFeedbackFieldsApiUrl(projectId, channelId);
const response = await fetch(url);
if (!response.ok) {
await handleApiError("피드백 필드 정보를 불러오는 데 실패했습니다.", response);
await handleApiError(
"피드백 필드 정보를 불러오는 데 실패했습니다.",
response,
);
}
const apiFields = await response.json();
@@ -82,8 +92,8 @@ export const getFeedbackFields = async (
}
return apiFields
.filter((field: any) => field.status === "ACTIVE")
.map((field: any) => ({
.filter((field: ApiField) => field.status === "ACTIVE")
.map((field: ApiField) => ({
id: field.key,
name: field.name,
type: field.format,
@@ -150,7 +160,10 @@ export const getFeedbackById = async (
const url = `/api/projects/${projectId}/channels/${channelId}/feedbacks/${feedbackId}`;
const response = await fetch(url);
if (!response.ok) {
await handleApiError("피드백 상세 정보를 불러오는 데 실패했습니다.", response);
await handleApiError(
"피드백 상세 정보를 불러오는 데 실패했습니다.",
response,
);
}
return response.json();
};