feat: feedback edit/delete buttons and author name on edit

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
EENE Dashboard
2026-06-05 23:04:55 +09:00
parent c93df1ae40
commit b8975098ae
3 changed files with 43 additions and 17 deletions

View File

@@ -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<string, string>;
const { content, authorName } = req.body as Record<string, string>;
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 } } },
});