feat: add primary tag functionality to tasks
- Introduced `primaryTagId` to `Task` model and updated related components to support selecting a primary tag. - Enhanced `TaskCard`, `EditTaskForm`, and `TagInput` to handle primary tag selection and display. - Updated `TasksService` to manage primary tag data during task creation and updates. - Added `emoji-regex` dependency for improved emoji handling in task titles.
This commit is contained in:
@@ -93,6 +93,7 @@ export async function updateTask(data: {
|
||||
status?: TaskStatus;
|
||||
priority?: TaskPriority;
|
||||
tags?: string[];
|
||||
primaryTagId?: string;
|
||||
dueDate?: Date;
|
||||
}): Promise<ActionResult> {
|
||||
try {
|
||||
@@ -109,6 +110,7 @@ export async function updateTask(data: {
|
||||
if (data.status !== undefined) updateData.status = data.status;
|
||||
if (data.priority !== undefined) updateData.priority = data.priority;
|
||||
if (data.tags !== undefined) updateData.tags = data.tags;
|
||||
if (data.primaryTagId !== undefined) updateData.primaryTagId = data.primaryTagId;
|
||||
if (data.dueDate !== undefined) updateData.dueDate = data.dueDate;
|
||||
|
||||
const task = await tasksService.updateTask(data.taskId, updateData);
|
||||
@@ -136,6 +138,7 @@ export async function createTask(data: {
|
||||
status?: TaskStatus;
|
||||
priority?: TaskPriority;
|
||||
tags?: string[];
|
||||
primaryTagId?: string;
|
||||
}): Promise<ActionResult> {
|
||||
try {
|
||||
if (!data.title.trim()) {
|
||||
@@ -147,7 +150,8 @@ export async function createTask(data: {
|
||||
description: data.description?.trim() || '',
|
||||
status: data.status || 'todo',
|
||||
priority: data.priority || 'medium',
|
||||
tags: data.tags || []
|
||||
tags: data.tags || [],
|
||||
primaryTagId: data.primaryTagId
|
||||
});
|
||||
|
||||
// Revalidation automatique du cache
|
||||
|
||||
Reference in New Issue
Block a user