summaryrefslogtreecommitdiff
path: root/queries/recent-matches.sql
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-01-27 15:11:51 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-01-27 15:11:51 +0100
commit9d995e47fd743f1a8ba18ee9daac7e822ad63660 (patch)
tree0ecb268183c921b22db268d8799c12eb44788a8b /queries/recent-matches.sql
parent16ba2a3e926105b2dd732e8cb28eddcdda1d1fc2 (diff)
downloadapigrabber-9d995e47fd743f1a8ba18ee9daac7e822ad63660.tar.gz
apigrabber-9d995e47fd743f1a8ba18ee9daac7e822ad63660.zip
api: /winrates endpoint
Diffstat (limited to 'queries/recent-matches.sql')
-rw-r--r--queries/recent-matches.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/queries/recent-matches.sql b/queries/recent-matches.sql
index fb237d7..9295813 100644
--- a/queries/recent-matches.sql
+++ b/queries/recent-matches.sql
@@ -1,7 +1,7 @@
-SELECT ARRAY_TO_JSON(ARRAY(
+SELECT ARRAY_TO_JSON(ARRAY(
SELECT
JSONB_BUILD_OBJECT(
- 'id', match.data->>'id',
+ 'id', (match.data->'attributes'->>'shardId') || (match.data->>'id'),
'date', match.data->'attributes'->>'createdAt',
'duration', CAST(
match.data->'attributes'->>'duration'
@@ -27,4 +27,4 @@ SELECT
)
FROM match
ORDER BY match.data->'attributes'->>'createdAt' DESC
-)) AS data
+)) AS data; \ No newline at end of file