Last active
January 2, 2016 15:59
-
-
Save istro/8327387 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expected json format: | |
GET /locations/ | |
{ locations: [ | |
{ | |
'id': 1, | |
'name': 'foo', | |
'postal': '123', | |
'roomIds': [1,2,3] | |
}, | |
{ | |
'id': 2, | |
'name': 'bar', | |
'postal': '123', | |
'roomIds': [3,4,5] | |
} | |
]} | |
------------------ | |
GET /locations/1 | |
{ location: { | |
'id': 1, | |
'name': 'foo', | |
'postal': '123', | |
'roomIds': [1,2,3] | |
} | |
} | |
------------------ | |
GET /locations/1/rooms/23 | |
{ room: { | |
'id': '23', | |
'name': 'kitchen', | |
etc. | |
... | |
'locationId': '1', <<<<<---- for belongsTo, need the owner's id in singular | |
'lightIds': [1,2,3] | |
} | |
} | |
-------------------- | |
final gotcha - on "create" action we need to return the saved object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment