Browse Source

group payments

feature/dockerfile-arm
Evan Feenstra 5 years ago
parent
commit
6a383f9063
  1. 11
      api/controllers/payment.ts
  2. 12
      dist/api/controllers/payment.js
  3. 2
      dist/api/controllers/payment.js.map

11
api/controllers/payment.ts

@ -20,6 +20,8 @@ const sendPayment = async (req, res) => {
text,
remote_text,
dimensions,
remote_text_map,
contact_ids,
} = req.body
console.log('[send payment]', req.body)
@ -87,8 +89,15 @@ const sendPayment = async (req, res) => {
}
if(remote_text) msgToSend.content = remote_text
// if contact_ids, replace that in "chat" below
// if remote text map, put that in
let theChat = chat
if(contact_ids){
theChat = {...chat.dataValues, contactIds:contact_ids}
if(remote_text_map) msgToSend.content = remote_text_map
}
helpers.sendMessage({
chat: chat,
chat: theChat,
sender: owner,
type: constants.message_types.direct_payment,
message: msgToSend,

12
dist/api/controllers/payment.js

@ -19,7 +19,7 @@ const lightning = require("../utils/lightning");
const ldat_1 = require("../utils/ldat");
const constants = require(__dirname + '/../../config/constants.json');
const sendPayment = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const { amount, chat_id, contact_id, destination_key, media_type, muid, text, remote_text, dimensions, } = req.body;
const { amount, chat_id, contact_id, destination_key, media_type, muid, text, remote_text, dimensions, remote_text_map, contact_ids, } = req.body;
console.log('[send payment]', req.body);
if (destination_key && !contact_id && !chat_id) {
return helpers.performKeysendMessage({
@ -79,8 +79,16 @@ const sendPayment = (req, res) => __awaiter(void 0, void 0, void 0, function* ()
}
if (remote_text)
msgToSend.content = remote_text;
// if contact_ids, replace that in "chat" below
// if remote text map, put that in
let theChat = chat;
if (contact_ids) {
theChat = Object.assign(Object.assign({}, chat.dataValues), { contactIds: contact_ids });
if (remote_text_map)
msgToSend.content = remote_text_map;
}
helpers.sendMessage({
chat: chat,
chat: theChat,
sender: owner,
type: constants.message_types.direct_payment,
message: msgToSend,

2
dist/api/controllers/payment.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save