fix image_api_get_all api call;
This commit is contained in:
parent
e2a09b465d
commit
f0174aadc7
@ -1,5 +1,4 @@
|
||||
from app_be.views.mongo_db import MongoManager
|
||||
from django.http import JsonResponse
|
||||
from app_be.services.hashservice import create_sha512
|
||||
|
||||
|
||||
@ -20,12 +19,15 @@ class MongoDBService:
|
||||
|
||||
db = instance.AIC
|
||||
col = db.metadata
|
||||
resp = []
|
||||
|
||||
try:
|
||||
for resp in col.find():
|
||||
print(resp)
|
||||
for meta in col.find():
|
||||
del meta['_id']
|
||||
resp.append(meta)
|
||||
except:
|
||||
print("Could not find Metadata")
|
||||
|
||||
return resp
|
||||
|
||||
@staticmethod
|
||||
|
||||
@ -35,7 +35,7 @@ class ImageEndpoint:
|
||||
metadata = MongoDBService.getAll()
|
||||
print(metadata)
|
||||
|
||||
return JsonResponse({'Result': 'success1'}, safe=False)
|
||||
return JsonResponse(metadata, safe=False)
|
||||
|
||||
@staticmethod
|
||||
@api_view(['GET'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user