Skip to content

Commit 5aea2b4

Browse files
committed
feat: finish updating api pages to use fancier components
1 parent 5ffe49f commit 5aea2b4

File tree

14 files changed

+1679
-2738
lines changed

14 files changed

+1679
-2738
lines changed

Diff for: src/app/v5/dev/api/contacts/page.mdx

-1,592
This file was deleted.

Diff for: src/app/v5/dev/api/counters/page.mdx

+109-83
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,119 @@
1-
# Counters API
2-
3-
## `GET /counters`
4-
5-
#### Description:
6-
7-
Fetches all available counters.
8-
9-
#### Example Request:
10-
11-
```
12-
GET /counters
13-
```
1+
export const metadata = {
2+
title: 'Counters',
3+
description: 'Documentation for counter API endpoints.',
4+
}
145

15-
#### Example Response:
6+
# Counters
167

17-
```json
18-
[
19-
{
20-
"id": "counter1",
21-
"name": "Counter 1",
22-
"value": 10
23-
},
24-
{
25-
"id": "counter2",
26-
"name": "Counter 2",
27-
"value": 15
28-
}
29-
]
30-
```
8+
The Counters API allows you to manage and retrieve counter values.
319

3210
---
3311

34-
## `GET /counters/:counterId`
35-
36-
#### Description:
37-
38-
Fetches a specific counter by its `counterId`.
39-
40-
#### Request Parameters:
41-
42-
- `counterId`: The unique identifier of the counter.
43-
44-
#### Example Request:
45-
46-
```
47-
GET /counters/counter1
48-
```
49-
50-
#### Example Response:
51-
52-
```json
53-
{
54-
"id": "counter1",
55-
"name": "Counter 1",
56-
"value": 10
57-
}
58-
```
12+
## List all counters {{ tag: 'GET', label: '/counters' }}
13+
14+
<Row>
15+
<Col>
16+
Retrieves a list of all counters
17+
</Col>
18+
19+
<Col sticky>
20+
<CodeGroup title="Request" tag="GET" label="/counters">
21+
```bash {{ title: 'cURL' }}
22+
curl http://localhost:7472/api/v1/counters
23+
```
24+
</CodeGroup>
25+
26+
```json {{ title: 'Response' }}
27+
[
28+
{
29+
"id": "counter1",
30+
"name": "Counter 1",
31+
"value": 10
32+
},
33+
{
34+
"id": "counter2",
35+
"name": "Counter 2",
36+
"value": 15
37+
}
38+
]
39+
```
40+
</Col>
41+
</Row>
5942

6043
---
6144

62-
## `POST /counters/:counterId`
63-
64-
#### Description:
65-
66-
Updates the value of an existing counter. Optionally, you can override the current value.
67-
68-
#### Request Parameters:
69-
70-
- `counterId`: The unique identifier of the counter to be updated.
71-
72-
#### Request Body:
45+
## Retrieve a counter {{ tag: 'GET', label: '/counters/:counterId' }}
46+
47+
<Row>
48+
<Col>
49+
Fetches a specific counter by its `counterId`.
50+
51+
### URL Parameters
52+
<Properties>
53+
<Property name="counterId" type="string" required>
54+
The unique identifier of the counter
55+
</Property>
56+
</Properties>
57+
</Col>
58+
59+
<Col sticky>
60+
<CodeGroup title="Request" tag="GET" label="/counters/counter1">
61+
```bash {{ title: 'cURL' }}
62+
curl http://localhost:7472/api/v1/counters/counter1
63+
```
64+
</CodeGroup>
65+
66+
```json {{ title: 'Response' }}
67+
{
68+
"id": "counter1",
69+
"name": "Counter 1",
70+
"value": 10
71+
}
72+
```
73+
</Col>
74+
</Row>
7375

74-
- `value`: The new value to set for the counter (required).
75-
- `override`: A boolean indicating whether to override the counter's current value (optional, defaults to `false`).
76-
77-
#### Example Request:
78-
79-
```json
80-
{
81-
"value": 20,
82-
"override": true
83-
}
84-
```
85-
86-
#### Example Response:
76+
---
8777

88-
```json
89-
{
90-
"oldValue": 10,
91-
"newValue": 20
92-
}
93-
```
78+
## Update a counter {{ tag: 'POST', label: '/counters/:counterId' }}
79+
80+
<Row>
81+
<Col>
82+
Updates the value of an existing counter. Optionally, you can override the current value.
83+
84+
### Request Parameters
85+
<Properties>
86+
<Property name="counterId" type="string" required>
87+
The unique identifier of the counter to be updated
88+
</Property>
89+
</Properties>
90+
91+
### Request Body
92+
<Properties>
93+
<Property name="value" type="number" required>
94+
The new value to set for the counter
95+
</Property>
96+
<Property name="override" type="boolean">
97+
A boolean indicating whether to override the counter's current value.
98+
If false, the new value will be added to the current value (optional, defaults to `false`)
99+
</Property>
100+
</Properties>
101+
</Col>
102+
103+
<Col sticky>
104+
<CodeGroup title="Request" tag="POST" label="/counters/counter1">
105+
```bash {{ title: 'cURL' }}
106+
curl -X POST http://localhost:7472/api/v1/counters/counter1 \
107+
-H "Content-Type: application/json" \
108+
-d '{"value": 20, "override": true}'
109+
```
110+
</CodeGroup>
111+
112+
```json {{ title: 'Response' }}
113+
{
114+
"oldValue": 10,
115+
"newValue": 20
116+
}
117+
```
118+
</Col>
119+
</Row>

0 commit comments

Comments
 (0)