feat : add task management with kanban and backlog
Add kanban board with drag-and-drop, backlog section, task/group drawers, DTOs, services, and i18n translations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
32
frontend/services/task-types.ts
Normal file
32
frontend/services/task-types.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { TaskType, TaskTypeWrite } from './dto/task-type'
|
||||
import type { HydraCollection } from '~/utils/api'
|
||||
import { extractHydraMembers } from '~/utils/api'
|
||||
|
||||
export function useTaskTypeService() {
|
||||
const api = useApi()
|
||||
|
||||
async function getAll(): Promise<TaskType[]> {
|
||||
const data = await api.get<HydraCollection<TaskType>>('/task_types')
|
||||
return extractHydraMembers(data)
|
||||
}
|
||||
|
||||
async function create(payload: TaskTypeWrite): Promise<TaskType> {
|
||||
return api.post<TaskType>('/task_types', payload as Record<string, unknown>, {
|
||||
toastSuccessKey: 'taskTypes.created',
|
||||
})
|
||||
}
|
||||
|
||||
async function update(id: number, payload: Partial<TaskTypeWrite>): Promise<TaskType> {
|
||||
return api.patch<TaskType>(`/task_types/${id}`, payload as Record<string, unknown>, {
|
||||
toastSuccessKey: 'taskTypes.updated',
|
||||
})
|
||||
}
|
||||
|
||||
async function remove(id: number): Promise<void> {
|
||||
await api.delete(`/task_types/${id}`, {}, {
|
||||
toastSuccessKey: 'taskTypes.deleted',
|
||||
})
|
||||
}
|
||||
|
||||
return { getAll, create, update, remove }
|
||||
}
|
||||
Reference in New Issue
Block a user