tasks

command module
v0.0.0-...-0b0618b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 11 Imported by: 0

README

Tasks

API Endpoints

GET /tasks - list all tasks

Query params:

  • category - filter tasks by category name
  • sortBy - sort by field (name, category, dueDate, status)
  • sortDir - sorting direction, asc or desc

Example: /tasks?category=Category%203&sortBy=name&sortDir=desc

GET /tasks/[taskId] - get a single task by id

Example: /tasks/1

{
    "id": 1,
    "name": "Do the dishes",
    "category": "Household",
    "dueDate": "2023-08-14",
    "status": "todo"
}

POST /tasks - Create new task.

Example:

{
    "name": "The new task",
    "category": "New",
    "dueDate": "2023-06-30",
    "status": "todo"
}

PUT /tasks/[taskId] - Update task

You only need to include the fields you want to update.

Example: /tasks/1

{
    "category": "Completed",
    "status": "done"
}

DELETE /tasks/[taskId] - Delete single task

Additional information

Due date is given in the format YYYY-MM-DD, e.g. 2023-08-24.

Status can be todo, doing or done.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL