File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ async function connect() {
96
96
97
97
async function readTodos ( ) {
98
98
try {
99
- const results = await postgres . query ( "select id, text from todos" ) ;
99
+ const results = await pool . query ( "select id, text from todos" ) ;
100
100
return results . rows ;
101
101
}
102
102
catch ( e ) {
@@ -107,7 +107,7 @@ async function readTodos() {
107
107
async function createTodo ( todoText ) {
108
108
109
109
try {
110
- await postgres . query ( "insert into todos (text) values ($1)" , [ todoText ] ) ;
110
+ await pool . query ( "insert into todos (text) values ($1)" , [ todoText ] ) ;
111
111
return true
112
112
}
113
113
catch ( e ) {
@@ -120,7 +120,7 @@ async function createTodo(todoText){
120
120
async function deleteTodo ( id ) {
121
121
122
122
try {
123
- await postgres . query ( "delete from todos where id = $1" , [ id ] ) ;
123
+ await pool . query ( "delete from todos where id = $1" , [ id ] ) ;
124
124
return true
125
125
}
126
126
catch ( e ) {
You can’t perform that action at this time.
0 commit comments