Closed sssoja closed 2 years ago
Name | Link |
---|---|
Latest commit | a34f9145b44b1052e597b50833a5bb8d21837dbe |
Latest deploy log | https://app.netlify.com/sites/vlab-research/deploys/62d193f6f0412f0008003da9 |
Name | Link |
---|---|
Latest commit | a34f9145b44b1052e597b50833a5bb8d21837dbe |
Latest deploy log | https://app.netlify.com/sites/virtuallab-videos/deploys/62d193f6606f770008e33216 |
Take a look at the line reference in the trace -> line 36. It's the this.query
- remember that this
is supposed to be an instance of the Pool
class from node-pg, elsewhere in the code. So probably you need to make sure you have a pool
there as well.
Take a look at the line reference in the trace -> line 36. It's the
this.query
- remember thatthis
is supposed to be an instance of thePool
class from node-pg, elsewhere in the code. So probably you need to make sure you have apool
there as well.
I updated the all
function which is currently binded to pool
so that it passes this
as a param to the _all
query. I then reference that instance as a param called pool
in the _all
query. I now get a different error pool.query is not a function
rather than this
reading as undefined.
In trying to isolate, I logged out pool
and I get the name of the survey Survey123
but nothing else. I've been reading up on pooling from the node-postgres docs, specifically pool.query
and as far as I can see the implementation is correct:
const { Pool } = require('pg')
const pool = new Pool()
pool
.query(QUERY)
So I'm wondering if I've got my use of this
and pool
muddled...
Looking good!
@nandanrao I just pushed a few more commits to reflect the changes discussed in standup.
I added a try-catch() to the all()
function and refactored the error message to one generic RequestError
so as to not get distracted by missing users credentials.
I'm just stuck on an error in my tests for surveyNotFound
and userNotFound
where my res
is returning undefined. Might just need to look at it with fresh eyes but let me know if you can spot where I'm going wrong.
The latest updates on your projects. Learn more about Vercel for Git ↗︎