Download references/comments/src/api/tasks.ts from mirasim-ai/devbrowse-bench: direct link, hf CLI and curl.
- Browser
- Download file 665 Bytes
-
https://huggingface.co/datasets/mirasim-ai/devbrowse-bench/resolve/main/references/comments/src/api/tasks.ts
- Command line
-
hf download hf://datasets/mirasim-ai/devbrowse-bench/references/comments/src/api/tasks.ts
-
curl -L -o tasks.ts https://huggingface.co/datasets/mirasim-ai/devbrowse-bench/resolve/main/references/comments/src/api/tasks.ts
665 Bytes
| import type { Comment, NewTask, Task, TaskPatch } from "../types"; | |
| import { api } from "./client"; | |
| export const tasksApi = { | |
| list: (query = "") => api.get<Task[]>(query ? `/tasks?q=${encodeURIComponent(query)}` : "/tasks"), | |
| get: (id: number) => api.get<Task>(`/tasks/${id}`), | |
| create: (task: NewTask) => api.post<Task>("/tasks", task), | |
| update: (id: number, patch: TaskPatch) => api.patch<Task>(`/tasks/${id}`, patch), | |
| remove: (id: number) => api.del<{ ok: true }>(`/tasks/${id}`), | |
| comments: (id: number) => api.get<Comment[]>(`/tasks/${id}/comments`), | |
| addComment: (id: number, body: string) => api.post<Comment>(`/tasks/${id}/comments`, { body }), | |
| }; | |