fix insert for gild recipient

This commit is contained in:
Akinwale Ariwodola 2017-09-24 09:10:07 +01:00
parent e9579b3f4b
commit 701aba56d3

5
app.js
View file

@ -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) ',