taskID is provided.
Endpoint
Request Body
The ID of an existing task to update. If provided, the task will be updated instead of creating a new one.
The name or title of the photography order task.
The due date for the task in ISO 8601 format (e.g.,
"2026-03-15T10:00:00Z").Additional details or notes about the task.
The current status of the task (e.g.,
"pending", "in-progress", "completed").The column or category for the task. Only used when updating a task with
taskID.Response
Returns
"Successful!" when the task is created or updated successfully.Returns
"Invalid!" if the operation fails.Example: Create New Task
Example: Update Existing Task
Response Example
Error Response
Behavior Notes
The
dueAt field is automatically converted to a JavaScript Date object before being stored in the database. Ensure you pass a valid ISO 8601 date string.When creating a new task (without
taskID), the taskColumn field is ignored. It uses the default value from the database schema.After successfully creating or updating a task, emit a
database-change event via Socket.io to notify other clients. See Real-time Updates for details.Database Schema
The task is stored with the following structure:Source Reference
Implementation:src/routes/api/(tasks-clients)/createNewTask/+server.ts:5