Open
Conversation
src/app/api/todos/route.ts
Outdated
| * | ||
| * @requestBody {Object} body | ||
| * @requestBody {string} body.title - The title of the todo item to create | ||
| * |
There was a problem hiding this comment.
Documentation improvement suggestion:
Suggested change
| * | |
| Adds a new item to the todo list. |
src/app/api/todos/route.ts
Outdated
| * @requestBody {Object} body | ||
| * @requestBody {string} body.title - The title of the todo item to create | ||
| * | ||
| * @returns {Promise<NextResponse>} The response object |
There was a problem hiding this comment.
Documentation improvement suggestion:
Suggested change
| * @returns {Promise<NextResponse>} The response object | |
| * |
src/app/api/todos/route.ts
Outdated
| * @requestBody {string} body.title - The title of the todo item to create | ||
| * | ||
| * @returns {Promise<NextResponse>} The response object | ||
| * @success {201} - Todo created successfully |
There was a problem hiding this comment.
Documentation improvement suggestion:
Suggested change
| * @success {201} - Todo created successfully | |
| * @route POST /api/todos - Endpoint for creating new todos. |
src/app/api/todos/route.ts
Outdated
| * | ||
| * @returns {Promise<NextResponse>} The response object | ||
| * @success {201} - Todo created successfully | ||
| * @error {400} - Invalid request body or missing/invalid title |
There was a problem hiding this comment.
Documentation improvement suggestion:
Suggested change
| * @error {400} - Invalid request body or missing/invalid title | |
| * |
src/app/api/todos/route.ts
Outdated
| * @returns {Promise<NextResponse>} The response object | ||
| * @success {201} - Todo created successfully | ||
| * @error {400} - Invalid request body or missing/invalid title | ||
| * |
There was a problem hiding this comment.
Documentation improvement suggestion:
Suggested change
| * | |
| * @param {NextRequest} request - Represents the incoming HTTP request. |
src/app/api/todos/route.ts
Outdated
| * @success {201} - Todo created successfully | ||
| * @error {400} - Invalid request body or missing/invalid title | ||
| * | ||
| * @example Request |
There was a problem hiding this comment.
Documentation improvement suggestion:
Suggested change
| * @example Request | |
| * |
src/app/api/todos/route.ts
Outdated
| * @error {400} - Invalid request body or missing/invalid title | ||
| * | ||
| * @example Request | ||
| * POST /api/todos |
There was a problem hiding this comment.
Documentation improvement suggestion:
Suggested change
| * POST /api/todos | |
| * @requestBody {Object} body - The object that contains the data to be processed. |
| * Get all them todos what is stored in the system | ||
| * | ||
| * @route {GET} /api/todos | ||
| * |
There was a problem hiding this comment.
Documentation improvement suggestion:
Suggested change
| * | |
| * Retrieve all todos stored in the system. | |
| * @route {GET} /api/todos | |
| * @return {Promise<NextResponse>} Returns all todo items available. | |
| * @success {200} - All todos successfully fetched. | |
| * @example Here's an example of the response: | |
| * HTTP/1.1 200 OK | |
| * [ | |
| * { | |
| * "id": "1234567890", | |
| * "title": "Do homework", | |
| * "completed": false, | |
| * "createdAt": "2024-03-21T10:00:00.000Z" | |
| * }, | |
| * { | |
| * "id": "0987654321", | |
| * "title": "Buy milk", | |
| * "completed": true, | |
| * "createdAt": "2024-03-20T15:30:00.000Z" | |
| * } | |
| * ] | |
| * @note This endpoint does not have error responses as it cannot fail. | |
| export async function GET() { | |
| return NextResponse.json(todos); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.