fix insert for gild recipient
This commit is contained in:
parent
e9579b3f4b
commit
701aba56d3
1 changed files with 5 additions and 0 deletions
5
app.js
5
app.js
|
@ -537,6 +537,11 @@ const sendGild = (sender, recipient, amount, gilddata, callback) => {
|
|||
return db.query('UPDATE Users SET Balance = Balance - ? WHERE Id = ?', [amount, data.senderId], cb);
|
||||
},
|
||||
(res, fields, cb) => {
|
||||
createOrGetUserId(recipient, cb);
|
||||
},
|
||||
(recipientId, cb) => {
|
||||
data.recipientId = recipientId;
|
||||
|
||||
// save the message
|
||||
const msgdata = gilddata.message.data;
|
||||
db.query( ['INSERT INTO Messages (AuthorId, Type, FullId, RedditId, ParentRedditId, Subreddit, Body, Context, RedditCreated, Created) ',
|
||||
|
|
Loading…
Reference in a new issue