From b8975098ae089fb365a7d5c02ad7abc23804415d Mon Sep 17 00:00:00 2001 From: EENE Dashboard Date: Fri, 5 Jun 2026 23:04:55 +0900 Subject: [PATCH] feat: feedback edit/delete buttons and author name on edit Co-authored-by: Cursor --- backend/src/routes/details.ts | 7 +++-- .../src/components/detail/FeedbackModal.tsx | 24 +++++++-------- frontend/src/pages/DetailPage.tsx | 29 +++++++++++++++++-- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/backend/src/routes/details.ts b/backend/src/routes/details.ts index 1bd2c61..8275398 100644 --- a/backend/src/routes/details.ts +++ b/backend/src/routes/details.ts @@ -44,7 +44,7 @@ router.post('/:taskId', async (req, res, next) => { // PATCH /api/details/item/:id router.patch('/item/:id', async (req, res, next) => { try { - const { content } = req.body as Record; + const { content, authorName } = req.body as Record; if (!content?.toString().trim()) throw new AppError(400, '피드백 내용은 필수입니다.'); const existing = await prisma.taskDetail.findUnique({ where: { id: req.params.id } }); @@ -52,7 +52,10 @@ router.patch('/item/:id', async (req, res, next) => { const detail = await prisma.taskDetail.update({ where: { id: req.params.id }, - data: { content: content.toString().trim() }, + data: { + content: content.toString().trim(), + ...(authorName !== undefined && { authorName: authorName?.toString().trim() || null }), + }, include: { author: { select: { id: true, name: true } } }, }); diff --git a/frontend/src/components/detail/FeedbackModal.tsx b/frontend/src/components/detail/FeedbackModal.tsx index 84470c5..46e3e21 100644 --- a/frontend/src/components/detail/FeedbackModal.tsx +++ b/frontend/src/components/detail/FeedbackModal.tsx @@ -66,18 +66,18 @@ export function FeedbackModal({ /> - {mode === 'add' && ( - - )} +
diff --git a/frontend/src/pages/DetailPage.tsx b/frontend/src/pages/DetailPage.tsx index d13cca4..299f65b 100644 --- a/frontend/src/pages/DetailPage.tsx +++ b/frontend/src/pages/DetailPage.tsx @@ -373,6 +373,7 @@ function DetailView({ task }: { task: TaskWithRelations }) { } else if (feedbackModal?.detail) { await apiClient.patch(`/details/item/${feedbackModal.detail.id}`, { content: data.content.trim(), + authorName: data.authorName.trim() || null, }); } await qc.invalidateQueries({ queryKey: ['task', task.id] }); @@ -516,23 +517,45 @@ function DetailView({ task }: { task: TaskWithRelations }) { }} > {sortedFeedbacks.length === 0 ? ( -

우클릭 또는 + 버튼으로 피드백을 추가하세요.

+

+ 버튼 또는 빈 곳 우클릭으로 피드백을 추가하세요.

) : (
{sortedFeedbacks.map((f) => (
{ e.preventDefault(); e.stopPropagation(); setFeedbackCtx({ x: e.clientX, y: e.clientY, detailId: f.id }); }} > -

+

{f.content} — {feedbackAuthorName(f)}

+
+ + +
))}