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:
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