Browse Source

sequelize like Op

feature/dockerfile-arm
Evan Feenstra 4 years ago
parent
commit
79bd957c9f
  1. 3
      api/network/modify.ts
  2. 3
      dist/api/network/modify.js
  3. 2
      dist/api/network/modify.js.map

3
api/network/modify.ts

@ -8,6 +8,7 @@ import * as FormData from 'form-data'
import { models } from '../models'
import * as RNCryptor from 'jscryptor'
import {sendMessage} from './send'
import { Op } from 'sequelize'
const constants = require(path.join(__dirname,'../../config/constants.json'))
const msgtypes = constants.message_types
@ -109,7 +110,7 @@ export async function sendFinalMemeIfFirstPurchaser(payload, chat, sender){
const host = mt.split('.')[0]
const ogPurchaseMessage = await models.Message.findOne({where:{
mediaToken: {$like: `${host}.${muid}%`}
mediaToken: {[Op.like]: `${host}.${muid}%`}
}})
console.log('ogPurchaseMessage',ogPurchaseMessage.dataValues)

3
dist/api/network/modify.js

@ -19,6 +19,7 @@ const FormData = require("form-data");
const models_1 = require("../models");
const RNCryptor = require("jscryptor");
const send_1 = require("./send");
const sequelize_1 = require("sequelize");
const constants = require(path.join(__dirname, '../../config/constants.json'));
const msgtypes = constants.message_types;
function modifyPayloadAndSaveMediaKey(payload, chat, sender) {
@ -117,7 +118,7 @@ function sendFinalMemeIfFirstPurchaser(payload, chat, sender) {
const termsAndKey = yield downloadAndUploadAndSaveReturningTermsAndKey(payload, chat, sender);
const host = mt.split('.')[0];
const ogPurchaseMessage = yield models_1.models.Message.findOne({ where: {
mediaToken: { $like: `${host}.${muid}%` }
mediaToken: { [sequelize_1.Op.like]: `${host}.${muid}%` }
} });
console.log('ogPurchaseMessage', ogPurchaseMessage.dataValues);
// send it to the purchaser

2
dist/api/network/modify.js.map

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