Browse Source

fix sql

push-params
Evan Feenstra 4 years ago
parent
commit
863f14287c
  1. 2
      api/controllers/actions.ts
  2. 2
      dist/api/controllers/actions.js
  3. 2
      dist/api/controllers/actions.js.map

2
api/controllers/actions.ts

@ -42,7 +42,7 @@ export const getBotsForTribe = async (req, res) => {
export const createBot = async (req, res) => {
const { chat_id, name, } = req.body
const chatId = parseInt(chat_id)
const chat = await models.Chat.findOne({where:{chatId}})
const chat = await models.Chat.findOne({where:{id:chatId}})
if(!chat) return failure(res,'no chat')
const owner = await models.Contact.findOne({where: {isOwner:true}})

2
dist/api/controllers/actions.js

@ -51,7 +51,7 @@ exports.getBotsForTribe = (req, res) => __awaiter(void 0, void 0, void 0, functi
exports.createBot = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const { chat_id, name, } = req.body;
const chatId = parseInt(chat_id);
const chat = yield models_1.models.Chat.findOne({ where: { chatId } });
const chat = yield models_1.models.Chat.findOne({ where: { id: chatId } });
if (!chat)
return res_1.failure(res, 'no chat');
const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } });

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

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