Skip to content

Commit

Permalink
"user" -> "person" dwyl/app#33 #1
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Jul 13, 2024
1 parent 853d40b commit ad71967
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 148 deletions.
10 changes: 7 additions & 3 deletions src/pages/reference_api/about.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# About API

The About API provides information about the Nextra framework, including its version, features, and capabilities. This endpoint is useful for retrieving metadata about your documentation site and can be utilized in various parts of your application.
The About API provides information about the `Nextra` framework,
including its version, features, and capabilities.
This endpoint is useful for retrieving metadata
about your documentation site and can be utilized
in various parts of your application.

## GET `/api/about`

Expand All @@ -9,9 +13,9 @@ The About API provides information about the Nextra framework, including its ver

The response includes the following fields:

- `version`: The current version of Nextra.
- `version`: The current version of `Nextra`.
- `features`: A list of features available in this version.
- `description`: A brief description of Nextra.
- `description`: A brief description of `Nextra`.

## Example

Expand Down
11 changes: 9 additions & 2 deletions src/pages/reference_api/index.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# API Reference Overview

The Nextra API Reference provides comprehensive information about the APIs available within the Nextra framework. This documentation is intended for developers who wish to integrate Nextra's features into their own applications or extend its functionality.
The `Nextra` API Reference provides comprehensive information about the APIs
available within the `Nextra` framework.
This documentation is intended for developers
who wish to integrate `Nextra` features into their own applications
or extend its functionality.

Explore the various API endpoints and learn how to effectively use them in your projects. Each section includes detailed descriptions, usage examples, and response formats to help you get started quickly and efficiently.
Explore the various API endpoints
and learn how to effectively use them in your projects.
Each section includes detailed descriptions, usage examples,
and response formats to help you get started quickly and efficiently.

Check out the individual API sections for more details:
- [About API](reference_api/about)
153 changes: 153 additions & 0 deletions src/pages/reference_api/person.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Person API

The `Person` API allows you to manage personal data
within your Nextra-powered documentation site.
This endpoint provides functionalities to create, retrieve, update,
and delete `person` information, making it a crucial component
for any personalized applications.

## Endpoints

### Get Person

Retrieve a list of all persons.

**Endpoint:**
```
GET /api/persons
```

**Response:**

The response includes a list of person objects,
each containing the following fields:
- `id`: The unique identifier for the person.
- `name`: The name of the person.
- `email`: The email address.
- `role`: The role of the person has in the system.

**Example:**

```json
[
{
"id": "1",
"name": "John Doe",
"email": "[email protected]",
"role": "admin"
},
{
"id": "2",
"name": "Jane Smith",
"email": "[email protected]",
"role": "editor"
}
]
```

### Create Person

Add a new user to the system.

**Endpoint:**
```
POST /api/person
```

**Request Body:**

The request body should include the following fields:
- `name` (required): The name of the person.
- `email` (required): The email address of the person.
- `role` (optional): The role of the person. Default is `viewer`.

**Example:**

```json
{
"name": "Alice Johnson",
"email": "[email protected]",
"role": "editor"
}
```

**Response:**

The response includes the created person object.

```json
{
"id": "3",
"name": "Alice Johnson",
"email": "[email protected]",
"role": "editor"
}
```

### Update Person

Modify an existing person's information.

**Endpoint:**
```
PUT /api/person/:id
```

**Request Body:**

The request body can include any of the following fields to update:
- `name` (optional): The name of the person.
- `email` (optional): The email address of the person.
- `role` (optional): The role of the person.

**Example:**

```json
{
"name": "Alice Johnson",
"email": "[email protected]",
"role": "admin"
}
```

**Response:**

The response includes the updated person object.

```json
{
"id": "3",
"name": "Alice Johnson",
"email": "[email protected]",
"role": "admin"
}
```

### Delete Person

Remove a person from the system.

**Endpoint:**
```
DELETE /api/person/:id
```

**Response:**

The response includes a confirmation message.

```json
{
"message": "User deleted successfully."
}
```

## Summary

The Person API provides essential operations
for managing people within your `Nextra` documentation site.
Whether you need to add a new person, update or remove existing ones,
these endpoints offer the flexibility
to handle all person-related tasks efficiently.
For more information on other available APIs,
refer back to the [API Reference](index).
142 changes: 0 additions & 142 deletions src/pages/reference_api/users.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ As you can see, you can group pages together in directories
thus organizing them neatly.

If you want a directory to have its own page,
you can simply add an `index.mdx` file.
you can simply add an `index.mdx` file in the directory.
Let's say we want `api_reference` to have an introductory page
when we click on it on the sidebar.
Simply create the `index.mdx` file:
Expand Down

0 comments on commit ad71967

Please sign in to comment.