summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-01 17:39:07 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-01 17:39:07 +0200
commit7ffc2723ea723e6115bf638b389db7c0ada141eb (patch)
tree267f0e35341be99601aed16270544cf0a35be8fe
parent6a0a5fafb3f7f3b5c8c8cdefa25fefb4b3e9ddfb (diff)
downloadapigrabber-7ffc2723ea723e6115bf638b389db7c0ada141eb.tar.gz
apigrabber-7ffc2723ea723e6115bf638b389db7c0ada141eb.zip
snakeCaseIfy in processor
-rw-r--r--worker.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/worker.js b/worker.js
index 3618c01..f29deca 100644
--- a/worker.js
+++ b/worker.js
@@ -5,7 +5,6 @@
var amqp = require("amqplib"),
request = require("request-promise"),
sleep = require("sleep-promise"),
- snakeCaseKeys = require("snakecase-keys"),
jsonapi = require("./jsonapi");
var MADGLORY_TOKEN = process.env.MADGLORY_TOKEN,
@@ -44,7 +43,7 @@ if (MADGLORY_TOKEN == undefined) throw "Need an API token";
// send match structure
await Promise.all(matches
.map(async (match) => await ch.sendToQueue("process",
- new Buffer(JSON.stringify(snakeCaseKeys(match))), {
+ new Buffer(JSON.stringify(match)), {
persistent: true,
type: "match",
headers: {
@@ -57,7 +56,7 @@ if (MADGLORY_TOKEN == undefined) throw "Need an API token";
await Promise.all(data.included
.filter((o) => o.type == "player" || o.type == "team")
.map(async (o) => await ch.sendToQueue("process",
- new Buffer(JSON.stringify(snakeCaseKeys(o))), {
+ new Buffer(JSON.stringify(o)), {
persistent: true,
type: o.type,
headers: {