Skip to content

Commit 49abf8e

Browse files
committed
Merge remote-tracking branch 'origin/main'
# Conflicts: # app.js
1 parent a29eb91 commit 49abf8e

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

app.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,4 @@ dbAdapter.connectToDatabase();
5353

5454
//start application
5555
const port = process.env.PORT || 3000;
56-
app.listen(port, () => debugStartup(`Listening on port ${port}...`));
57-
58-
56+
app.listen(port, () => debugStartup(`Listening on port ${port}...`));

services/dbAdapter.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ async function getUserByUsername(username) {
3434
return result.rows[0];
3535
}
3636

37+
async function getUserByEmailVerificationCode(code) {
38+
// Abfrage ausführen
39+
const result = await client.query('SELECT * FROM users WHERE email_verification_code = $1', [code])
40+
return result.rows[0];
41+
}
42+
43+
3744
async function updateUser(user) {
3845
const query = `
3946
UPDATE users
@@ -115,5 +122,6 @@ module.exports = {
115122
disconnectFromDatabase,
116123
createUser,
117124
getUserByUsername,
118-
updateUser
125+
updateUser,
126+
getUserByEmailVerificationCode
119127
}

0 commit comments

Comments
 (0)