feature: Tasks tab added for lab organizations. tasks now can be assigned and their status can be updated by the assignee.
This commit is contained in:
@@ -34,7 +34,7 @@ export const casesApi = {
|
||||
updateTask: async (
|
||||
caseId: string,
|
||||
taskId: string,
|
||||
payload: { assigneeUserId?: string | null; status?: LabCaseTask['status'] },
|
||||
payload: { assigneeUserId?: string | null; priority?: number },
|
||||
): Promise<{ success: boolean; data: LabCaseTask }> => {
|
||||
const response = await apiClient.patch(`/cases/${caseId}/tasks/${taskId}`, payload);
|
||||
return response.data;
|
||||
|
||||
20
frontend/src/lib/api/tasks.ts
Normal file
20
frontend/src/lib/api/tasks.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { apiClient } from './client';
|
||||
import type { LabTaskListItem, LabTaskStatus, PaginatedLabTasks } from '@/types/cases';
|
||||
|
||||
export const tasksApi = {
|
||||
list: async (params: { page?: number; limit?: number } = {}): Promise<{
|
||||
success: boolean;
|
||||
data: PaginatedLabTasks;
|
||||
}> => {
|
||||
const response = await apiClient.get('/tasks', { params });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
updateStatus: async (
|
||||
taskId: string,
|
||||
status: LabTaskStatus,
|
||||
): Promise<{ success: boolean; data: LabTaskListItem }> => {
|
||||
const response = await apiClient.patch(`/tasks/${taskId}`, { status });
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user