Tweak how we return single record data from API

i.e. always return 'data' key with object data, regardless of model
This commit is contained in:
Lance Edgar 2019-08-29 22:53:39 -05:00
parent 56974ce30f
commit 7aa5c8e724

View file

@ -226,7 +226,9 @@ class APIMasterView(APIView):
obj = self.Session.query(self.get_model_class()).get(uuid)
if not obj:
raise self.notfound()
return {self.get_object_key(): self.normalize(obj)}
key = self.get_object_key()
normal = self.normalize(obj)
return {key: normal, 'data': normal}
def _collection_post(self):
"""