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 app_be.views.mongo_db import MongoManager
|
||||||
from django.http import JsonResponse
|
|
||||||
from app_be.services.hashservice import create_sha512
|
from app_be.services.hashservice import create_sha512
|
||||||
|
|
||||||
|
|
||||||
@ -20,12 +19,15 @@ class MongoDBService:
|
|||||||
|
|
||||||
db = instance.AIC
|
db = instance.AIC
|
||||||
col = db.metadata
|
col = db.metadata
|
||||||
|
resp = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for resp in col.find():
|
for meta in col.find():
|
||||||
print(resp)
|
del meta['_id']
|
||||||
|
resp.append(meta)
|
||||||
except:
|
except:
|
||||||
print("Could not find Metadata")
|
print("Could not find Metadata")
|
||||||
|
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class ImageEndpoint:
|
|||||||
metadata = MongoDBService.getAll()
|
metadata = MongoDBService.getAll()
|
||||||
print(metadata)
|
print(metadata)
|
||||||
|
|
||||||
return JsonResponse({'Result': 'success1'}, safe=False)
|
return JsonResponse(metadata, safe=False)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@api_view(['GET'])
|
@api_view(['GET'])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user