appbaseio / appbase-js

appbase.io search client library for JavaScript
MIT License
42 stars 18 forks source link

searchStreamToURL with different request objects does not create new object in percolator #12

Closed yashshah closed 2 years ago

yashshah commented 8 years ago

Here is my code:

/* Query to check if the new status is posted with specific team_id */
  var requestObject = {
    type: "statuses",
    body: {
      query: {
        match: {
          "team_id": team_id
        }
      }
    }
  };

  var statusBodyObject = {
    "text": "@{{{user_name}}} is working on {{{status}}}"
  }

  var webhookObject = {
    'method': 'POST',
    'url': webhookUrl,
    'body': statusBodyObject
  }

  appbaseRef.searchStreamToURL(requestObject, webhookObject).on('data', function(stream) {
    console.log("Webhook initialized: ", JSON.stringify(stream))
  }).on('error', function(error) {
    console.log("Query error: ", JSON.stringify(error))
  });

Here is my response:

image

It is always created: false even though I have different team_id value in the request object.