From 701aba56d36f0f44881b7512c5879c62e9138a97 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 24 Sep 2017 09:10:07 +0100 Subject: [PATCH] fix insert for gild recipient --- app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.js b/app.js index 4e10bb7..ae35610 100644 --- a/app.js +++ b/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) ',