Closed nuppal13 closed 2 years ago
Hiya Nuppal,
I'm not quite sure what this issue has to do with my library. This library is just a wrapper around the 2captcha website (https://2captcha.com/), has nothing to do with a SQL context.. I'm closing this issue, feel free to re-open it if you have more information on how this issue is related to this repository.
Hi, I'm getting the below error every time. I'm not able to understand how can I destructure it. const {lastID} = await this.sqlite.run(
INSERT INTO user (firstName, lastName, nickName, email, password, isTeacher) VALUES ($firstName, $lastName, $nickName, $email, $password, $isTeacher)
, ^ TypeError: Cannot destructure property 'lastID' of '(intermediate value)' as it is undefined.Here is code snippet - const {lastID} = await this.sqlite.run(
INSERT INTO user (firstName, lastName, nickName, email, password, isTeacher) VALUES ($firstName, $lastName, $nickName, $email, $password, $isTeacher)
, { $firstName, $lastName, $nickName, $email, $password, $isTeacher }).then((result)=>{ if(result !=null){console.log(result); }
}).catch(err=>{ console.log("Email already exists"); return err; }); return lastID; }
Please advise.