Skip to content

Commit

Permalink
each doc insert as signed payload from client
Browse files Browse the repository at this point in the history
  • Loading branch information
admin-adb committed Mar 9, 2021
1 parent bcbf119 commit 2c5ba42
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ def insert_docs (docs, database_name):
# and add CID

for doc_ in docs:
if schema.validate_json_docs(database_h["schema"]["validator"], doc_):
CID_ = CID.doc2CID(doc_)
payload = doc_["payload"]
if schema.validate_json_docs(database_h["schema"]["validator"], payload):
CID_ = CID.doc2CID(payload)
cids_.append(CID_)
doc_["CID"] = CID_
docs_.append(doc_)
payload["CID"] = CID_
docs_.append(payload)
else:
cids_.append(None)

Expand Down

0 comments on commit 2c5ba42

Please sign in to comment.