Skip to content

Commit

Permalink
rename short_id to shortId in json api
Browse files Browse the repository at this point in the history
  • Loading branch information
reedstrm committed Nov 8, 2015
1 parent c2ebf9b commit 4f4409a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cnxarchive/sql/get-module-metadata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
SELECT row_to_json(combined_rows) AS module
FROM (SELECT
m.uuid AS id,
short_id(m.uuid) as short_id,
short_id(m.uuid) as "shortId",
concat_ws('.', m.major_version, m.minor_version) AS current_version,
-- can't use "version" as we need it in GROUP BY clause and it causes a
-- "column name is ambiguous" error
Expand Down Expand Up @@ -65,7 +65,7 @@ FROM (SELECT
(SELECT row_to_json(parent_row)
FROM (
SELECT p.uuid AS id,
short_id(p.uuid) as short_id,
short_id(p.uuid) as "shortId",
concat_ws('.', p.major_version, p.minor_version) AS version,
p.name AS title,
ARRAY(SELECT row_to_json(user_rows)
Expand Down
2 changes: 1 addition & 1 deletion cnxarchive/sql/get-module.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
SELECT row_to_json(combined_rows) as module
FROM (SELECT
m.uuid AS id,
short_id(m.uuid) as short_id,
short_id(m.uuid) as "shortId",

concat_ws('.', m.major_version, m.minor_version) AS current_version,
-- can't use "version" as we need it in GROUP BY clause and it causes a
Expand Down
16 changes: 8 additions & 8 deletions cnxarchive/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
u'created': u'2013-07-31T19:07:20Z',
u'doctype': u'',
u'id': u'e79ffde3-7fb4-4af3-9ec8-df648b391597',
u'short_id': u'55_943-0',
u'shortId': u'55_943-0',
u'language': u'en',
u'license': {
u'code': u'by',
Expand Down Expand Up @@ -84,11 +84,11 @@
u'parentTitle': None,
u'parentVersion': '',
u'parent': {
'authors': [],
'id': None,
'short_id': None,
'title': None,
'version': '',
u'authors': [],
u'id': None,
u'shortId': None,
u'title': None,
u'version': '',
},
u'revised': u'2013-08-31T19:07:20Z',
u'stateid': None,
Expand Down Expand Up @@ -229,7 +229,7 @@
u'created': u'2013-07-31T19:07:24Z',
u'doctype': u'',
u'id': u'56f1c5c1-4014-450d-a477-2121e276beca',
u'short_id': u'VvHFwUAU',
u'shortId': u'VvHFwUAU',
u'language': u'en',
u'license': {
u'code': u'by',
Expand Down Expand Up @@ -268,7 +268,7 @@
u'parent': {
u'authors': [],
u'id': None,
'short_id': None,
u'shortId': None,
u'title': None,
u'version': '',
},
Expand Down

0 comments on commit 4f4409a

Please sign in to comment.