Retrieve all tasks in the PhotoFlow system, including their associated metadata.
Endpoint
Despite being a read operation, this endpoint uses the POST method following SvelteKit conventions.
Request Body
This endpoint does not require any request body parameters.
Response
An array of task objects.
The unique identifier for the task.
The name or title of the task.
The due date for the task in ISO 8601 format.
tasks[].additional_information
Additional details or notes about the task.
The current status of the task.
Whether the task has been marked as finished.
The column or category for the task.
The number of comments associated with this task.
The timestamp when the task was created in ISO 8601 format.
Example Request
cURL
JavaScript
With Socket.io
curl -X POST http://localhost:5173/api/getUserTasks \
-H "Content-Type: application/json"
Response Example
[
{
"id" : 1 ,
"task" : "Wedding photoshoot - Johnson family" ,
"dueAt" : "2026-03-15T10:00:00.000Z" ,
"additional_information" : "Outdoor ceremony at Central Park" ,
"status" : "pending" ,
"is_finished" : false ,
"taskColumn" : "1" ,
"amount_of_comments" : 3 ,
"created_at" : "2026-03-01T09:00:00.000Z"
},
{
"id" : 2 ,
"task" : "Portrait session - Smith" ,
"dueAt" : "2026-03-20T14:00:00.000Z" ,
"additional_information" : "Family of 4, studio session" ,
"status" : "in-progress" ,
"is_finished" : false ,
"taskColumn" : "2" ,
"amount_of_comments" : 1 ,
"created_at" : "2026-03-02T11:30:00.000Z"
},
{
"id" : 3 ,
"task" : "Product photography - ABC Corp" ,
"dueAt" : "2026-03-25T09:00:00.000Z" ,
"additional_information" : "50 product shots, white background" ,
"status" : "completed" ,
"is_finished" : true ,
"taskColumn" : "3" ,
"amount_of_comments" : 5 ,
"created_at" : "2026-02-28T15:00:00.000Z"
}
]
Error Response
If an error occurs during the database query:
Note the trailing space in the error message - this is the actual response from the API.
Filtering and Sorting
This endpoint returns ALL tasks from the database without pagination, filtering, or sorting. If you need to filter tasks by status, column, or finished state, you’ll need to implement that logic on the client side.
Database Query
The endpoint executes a simple Prisma query:
const tasks = await prisma . tasks . findMany ();
This returns all fields from the Tasks table, including the related amount_of_comments field.
Source Reference
Implementation: src/routes/api/(tasks-clients)/getUserTasks/+server.ts:5