message ids array

This commit is contained in:
Lukas Nowy 2019-03-17 16:12:12 +01:00
parent 631e7103d0
commit 51bcef67fe

View File

@ -11,8 +11,9 @@ const stringSimilarity = require('string-similarity');
async function updateUser(uid, mid, name, picture, email) {
try {
await nonQuery('INSERT INTO "User" (username, message_id, name, picture, email) VALUES ($1, $2, $3, $4, $5);', [uid, mid, name, picture, email]);
await nonQuery('INSERT INTO "User" (username, name, picture, email) VALUES ($1, $2, $3, $4);', [uid, name, picture, email]);
await nonQuery('UPDATE "User" SET message_id = array_append(message_id, $1) WHERE username = $2 ;', [mid, uid]);
} catch (error) {
console.error(error);
}