<commit_before>"use strict";

const express = require('express');
const router = express.Router();

module.exports = (knex) => {

  router.post('/', function(req, res) {
    knex('order').select('status').where('phone', '=', req.body.From).asCallback((err, row) => {
      if (err) console.error(err);
      var status = row[0].status;
      if (status === 'ordered') {
        if (req.body.Body.toLowerCase() === 'confirm') {<commit_msg>fixing router<commit_after>"use strict";

const express = require('express');
const router = express.Router();

module.exports = (knex) => {


  //helper functions
  function respond(message, callback) {
    //generate twiml message and continue code after message is sent
    var twiml = new MessagingResponse();
    twiml.message(message);
    res.writeHead(200, {
      'Content-Type': 'text/xml'
    });
    callback()
    //respond with the message header
    res.end(twiml.toString)
  }

  //function to use when user has yet to receive any messages
  function message(message, to, from, callback) {
    client.messages.create({
      to: to,
      from: from,
      body: message
    }).then((message) => console.log(message.sid));
    callback();
  }


  router.post('/', function(req, res) {
    knex('order').select('status').where('phone', '=', req.body.From).asCallback((err, row) => {
      if (err) console.error(err);
      var status = row[0].status;
      if (status === 'ordered') {
        if (req.body.Body.toLowerCase() === 'confirm') {
{'fraction_non_alphanumeric': 0.1765886287625418, 'fraction_numerical': 0.0033444816053511705, 'mean_word_length': 3.286532951289398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1621894', 'n_tokens_mistral': 465, 'n_tokens_neox': 460, 'n_words': 113}