Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit eca9d30

Browse files
raksivdavemooreuws
authored andcommitted
change text to content to fix formatting issues.
1 parent 033ae99 commit eca9d30

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

docs/guides/nodejs/nitric-and-pgsql.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Create a migration file to define the `todos` table.
7272
```sql title: migrations/todos/1_create_table.up.sql
7373
CREATE TABLE IF NOT EXISTS todos (
7474
id SERIAL PRIMARY KEY,
75-
text TEXT NOT NULL,
75+
content TEXT NOT NULL,
7676
done BOOLEAN DEFAULT FALSE
7777
);
7878
```
@@ -98,21 +98,21 @@ mainApi.get('/todos', async (ctx) => {
9898

9999
// Insert a new todo
100100
mainApi.post('/todos/', async (ctx) => {
101-
const { text } = ctx.req.json()
101+
const { content } = ctx.req.json()
102102
const client = await getClient()
103-
await client.query('INSERT INTO todos (text, done) VALUES ($1, $2)', [
104-
text,
103+
await client.query('INSERT INTO todos (content, done) VALUES ($1, $2)', [
104+
content,
105105
false,
106106
])
107107
})
108108

109-
// Update text of a todo
109+
// Update content of a todo
110110
mainApi.patch('/todos/:id', async (ctx) => {
111111
const { id } = ctx.req.params
112-
const { text } = ctx.req.json()
112+
const { content } = ctx.req.json()
113113
const client = await getClient()
114-
await client.query('UPDATE todos SET text = $1 WHERE id = $2', [
115-
text,
114+
await client.query('UPDATE todos SET content = $1 WHERE id = $2', [
115+
content,
116116
parseInt(id),
117117
])
118118
})
@@ -149,7 +149,7 @@ Using the dashboard, apply your migrations from the databases tab to initialize
149149

150150
### Add some todos using the Nitric dashboard
151151

152-
Open the local dashboard at <a target="_blank" href="http://localhost:49152">localhost:49152</a>, then navigate to the `POST /todos` endpoint and add some content to the body of the request, stating the `text` key and value of the todo task and click send.
152+
Open the local dashboard at <a target="_blank" href="http://localhost:49152">localhost:49152</a>, then navigate to the `POST /todos` endpoint and add some content to the body of the request, stating the `content` key and value of the todo task and click send.
153153

154154
![Add text content for the todo](/docs/images/guides/nitric-and-pgsql/step-2.png)
155155

2.89 KB
Loading
4.08 KB
Loading
-10.2 KB
Loading
962 Bytes
Loading

0 commit comments

Comments
 (0)