Skip to content

post docu pr#7

Open
deniseurbanija wants to merge 5 commits intomainfrom
post-doc
Open

post docu pr#7
deniseurbanija wants to merge 5 commits intomainfrom
post-doc

Conversation

@deniseurbanija
Copy link
Collaborator

No description provided.

*
* @requestBody {Object} body
* @requestBody {string} body.title - The title of the todo item to create
*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
*
Adds a new item to the todo list.

* @requestBody {Object} body
* @requestBody {string} body.title - The title of the todo item to create
*
* @returns {Promise<NextResponse>} The response object
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
* @returns {Promise<NextResponse>} The response object
*

* @requestBody {string} body.title - The title of the todo item to create
*
* @returns {Promise<NextResponse>} The response object
* @success {201} - Todo created successfully
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
* @success {201} - Todo created successfully
* @route POST /api/todos - Endpoint for creating new todos.

*
* @returns {Promise<NextResponse>} The response object
* @success {201} - Todo created successfully
* @error {400} - Invalid request body or missing/invalid title
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
* @error {400} - Invalid request body or missing/invalid title
*

* @returns {Promise<NextResponse>} The response object
* @success {201} - Todo created successfully
* @error {400} - Invalid request body or missing/invalid title
*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
*
* @param {NextRequest} request - Represents the incoming HTTP request.

* @success {201} - Todo created successfully
* @error {400} - Invalid request body or missing/invalid title
*
* @example Request
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
* @example Request
*

* @error {400} - Invalid request body or missing/invalid title
*
* @example Request
* POST /api/todos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
* POST /api/todos
* @requestBody {Object} body - The object that contains the data to be processed.

*
* @example Request
* POST /api/todos
* Content-Type: application/json
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
* Content-Type: application/json
* @requestBody {string} body.title - Specifies the title for the new todo item.

* @example Request
* POST /api/todos
* Content-Type: application/json
*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
*
*

* POST /api/todos
* Content-Type: application/json
*
* @example
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation improvement suggestion:

Suggested change
* @example
* @returns {Promise<NextResponse>} Returns a promise that resolves to the response object.

* Get all them todos what is stored in the system
*
* @route {GET} /api/todos
*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
}

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