Skip to content

Commit fa19cf0

Browse files
committed
restore old code for audeince
1 parent 212d7f1 commit fa19cf0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

express-postgres/server.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async function connect() {
9696

9797
async function readTodos() {
9898
try {
99-
const results = await postgres.query("select id, text from todos");
99+
const results = await pool.query("select id, text from todos");
100100
return results.rows;
101101
}
102102
catch(e){
@@ -107,7 +107,7 @@ async function readTodos() {
107107
async function createTodo(todoText){
108108

109109
try {
110-
await postgres.query("insert into todos (text) values ($1)", [todoText]);
110+
await pool.query("insert into todos (text) values ($1)", [todoText]);
111111
return true
112112
}
113113
catch(e){
@@ -120,7 +120,7 @@ async function createTodo(todoText){
120120
async function deleteTodo(id){
121121

122122
try {
123-
await postgres.query("delete from todos where id = $1", [id]);
123+
await pool.query("delete from todos where id = $1", [id]);
124124
return true
125125
}
126126
catch(e){

0 commit comments

Comments
 (0)