tm-authors-api
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -8,6 +8,5 @@ { | ||
"region": "eu-west-1", | ||
"tableName": "AuthorsStateStore-test", | ||
"endpoint": "http://localhost:8000" | ||
"tableName": "AuthorsStateStore-vulcan" | ||
}, | ||
"logging": true | ||
} |
@@ -10,3 +10,3 @@ { | ||
"name": "presentation", | ||
"image": "trinitymirror/authors-api:2.0.2", | ||
"image": "trinitymirror/authors-api:2.0.4", | ||
"essential": "true", | ||
@@ -13,0 +13,0 @@ "memory": 1700, |
{ | ||
"name": "tm-authors-api", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,3 +26,3 @@ "use strict"; | ||
} else { | ||
res.send(result.Item); | ||
res.send(converId(result.Item)); | ||
} | ||
@@ -52,3 +52,4 @@ }); | ||
} else { | ||
res.send(result.Responses[tableName]); | ||
const response = result.Responses[tableName].map(converId); | ||
res.send(response); | ||
} | ||
@@ -58,1 +59,12 @@ }); | ||
}; | ||
function converId(item) { | ||
const id = `${item.Source.split("-")[0]}.${item.Id}`; | ||
return R.pipe( | ||
R.assoc("id", id), | ||
R.omit([ | ||
"Source", | ||
"Id" | ||
]) | ||
)(item); | ||
} |
@@ -99,3 +99,7 @@ "use strict"; | ||
.end((err, res) => { | ||
assert.deepEqual(res.body, testAuthor); | ||
assert.deepEqual(res.body.name, 'Jim Author'); | ||
assert.deepEqual(res.body.url, 'www.mirror.co.uk/authors/author-jim'); | ||
assert.deepEqual(res.body.twitterId, 'a_twitter_id'); | ||
assert.deepEqual(res.body.imageUrl, 'www.mirror.co.uk/incoming/article121234.ese/ALTERNATIES/s98/title.png'); | ||
assert.deepEqual(res.body.id, 'nationals.123'); | ||
done(); | ||
@@ -172,2 +176,3 @@ }); | ||
assert.equal(res.body.length, 1); | ||
assert.equal(res.body[0].id, "nationals.1234"); | ||
assert.equal(res.body[0].url, "www.mirror.co.uk/authors/kimmy-k"); | ||
@@ -174,0 +179,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9906
294