Update task schema with show toggles and keywords
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -53,6 +53,10 @@ model Task {
|
||||
startDate DateTime?
|
||||
dueDate DateTime?
|
||||
showDate Boolean @default(true)
|
||||
showDescription Boolean @default(true)
|
||||
showStatus Boolean @default(true)
|
||||
showIssue Boolean @default(true)
|
||||
keywords String?
|
||||
creatorId String
|
||||
assigneeId String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@ -56,7 +56,8 @@ router.get('/:id', async (req, res, next) => {
|
||||
router.post('/', async (req, res, next) => {
|
||||
try {
|
||||
const { title, description, status, priority, quarter, category,
|
||||
section, tag, taskType, progress, issueNote, startDate, dueDate, assigneeId, showDate } =
|
||||
section, tag, taskType, progress, issueNote, startDate, dueDate, assigneeId, showDate,
|
||||
showDescription, showStatus, showIssue, keywords } =
|
||||
req.body as Record<string, any>;
|
||||
|
||||
if (!title || !quarter) {
|
||||
@@ -79,6 +80,10 @@ router.post('/', async (req, res, next) => {
|
||||
startDate: startDate ? new Date(startDate) : undefined,
|
||||
dueDate: dueDate ? new Date(dueDate) : undefined,
|
||||
showDate: showDate !== undefined ? showDate === 'true' || showDate === true : true,
|
||||
showDescription: showDescription !== undefined ? showDescription === 'true' || showDescription === true : true,
|
||||
showStatus: showStatus !== undefined ? showStatus === 'true' || showStatus === true : true,
|
||||
showIssue: showIssue !== undefined ? showIssue === 'true' || showIssue === true : true,
|
||||
keywords: keywords || null,
|
||||
assigneeId: assigneeId || null,
|
||||
creatorId: (req.body as Record<string, string>).creatorId ?? 'system',
|
||||
},
|
||||
@@ -97,7 +102,8 @@ router.patch('/:id', async (req, res, next) => {
|
||||
if (!existing) throw new AppError(404, '업무를 찾을 수 없습니다.');
|
||||
|
||||
const { title, description, status, priority, quarter, category,
|
||||
section, tag, taskType, progress, issueNote, startDate, dueDate, assigneeId, showDate } =
|
||||
section, tag, taskType, progress, issueNote, startDate, dueDate, assigneeId, showDate,
|
||||
showDescription, showStatus, showIssue, keywords } =
|
||||
req.body as Record<string, any>;
|
||||
|
||||
const task = await prisma.task.update({
|
||||
@@ -118,6 +124,10 @@ router.patch('/:id', async (req, res, next) => {
|
||||
...(dueDate !== undefined && { dueDate: dueDate ? new Date(dueDate) : null }),
|
||||
...(assigneeId !== undefined && { assigneeId: assigneeId || null }),
|
||||
...(showDate !== undefined && { showDate: showDate === true || showDate === 'true' }),
|
||||
...(showDescription !== undefined && { showDescription: showDescription === true || showDescription === 'true' }),
|
||||
...(showStatus !== undefined && { showStatus: showStatus === true || showStatus === 'true' }),
|
||||
...(showIssue !== undefined && { showIssue: showIssue === true || showIssue === 'true' }),
|
||||
...(keywords !== undefined && { keywords: keywords || null }),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user