Skip to content

[Auto] Implement Create Todo endpoint (POST /todos)#17

Draft
landoyjx wants to merge 1 commit intomainfrom
auto/4-implement-create-todo-endpoint--post--todos-119
Draft

[Auto] Implement Create Todo endpoint (POST /todos)#17
landoyjx wants to merge 1 commit intomainfrom
auto/4-implement-create-todo-endpoint--post--todos-119

Conversation

@landoyjx
Copy link
Copy Markdown
Owner

Implement POST /todos to create a new Todo item. Request body must contain title (string, non-empty). Response should be 201 Created with the full Todo object.

Acceptance Criteria:

  • Returns 201 and the created Todo on success
  • Returns 400 if title is missing, null, or empty string
  • createdAt and updatedAt are set automatically

Test Cases:

  • Integration: POST /todos with { "title": "Buy milk" } returns 201 and a Todo object with id, title, completed=false, createdAt, updatedAt
  • Integration: POST /todos with { "title": "" } returns 400 with JSON error
  • Integration: POST /todos with {} returns 400 with JSON error
  • Edge: POST /todos with extra fields ignores them and still creates the Todo

View issue: #4


Created by bass auto-programming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant