피드백 등록 및 리스트업.

This commit is contained in:
2025-07-30 18:11:01 +09:00
parent ba9b7a27ef
commit e2cb482e5c
28 changed files with 1942 additions and 498 deletions

View File

@@ -0,0 +1,41 @@
// src/services/issue.ts
import { handleApiError } from "./error";
// API 응답에 대한 타입을 정의합니다.
// 실제 API 명세에 따라 더 구체적으로 작성해야 합니다.
export interface Issue {
id: string;
title: string;
feedbackCount: number;
description: string;
status: string;
createdAt: string;
updatedAt: string;
category: string;
[key: string]: any; // 그 외 다른 필드들
}
/**
* 특정 프로젝트의 모든 이슈를 검색합니다.
* @param projectId 프로젝트 ID
* @returns 이슈 목록 Promise
*/
export const getIssues = async (projectId: string): Promise<Issue[]> => {
const url = `/api/projects/${projectId}/issues/search`;
// body를 비워서 보내면 모든 이슈를 가져오는 것으로 가정합니다.
// 실제 API 명세에 따라 수정이 필요할 수 있습니다.
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
if (!response.ok) {
await handleApiError("이슈 목록을 불러오는 데 실패했습니다.", response);
}
const result = await response.json();
return result.items || [];
};