Skip to content

Commit

Permalink
fix api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshhewabi committed Apr 4, 2024
1 parent 82394c9 commit b2fbe28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# The middleware will handle both standard and streaming responses.
# Do not GZip responses that are smaller than this minimum size in bytes,
# Tier 4 Network level compression, no need to worry at Tier 7(HTTPS) level
app.add_middleware(GZipMiddleware, minimum_size=1000)
# app.add_middleware(GZipMiddleware, minimum_size=1000)

app.include_router(pride_router, prefix="/pride/ws/archive/crosslinking")
app.include_router(pdbdev_router, prefix="/pride/ws/archive/crosslinking/pdbdev")
Expand Down
8 changes: 6 additions & 2 deletions app/routes/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,16 @@ async def write_data(

@parser_router.post("/write_new_upload", tags=["Parser"])
def write_new_upload(
table: Annotated[TableNamesEnum, Body(..., description="table name", embeded=True)],
data: dict = Body(..., description="table data", embeded=True),
api_key: str = Security(get_api_key),
session: Session = Depends(get_session)):
try:
new_upload = Upload(**data)
print("called write_new_upload!!!")
new_upload = Upload(
identification_file_name=data['identification_file_name'],
identification_file_name_clean=data['identification_file_name_clean'],
project_id=data['project_id']
)
session.add(new_upload)
session.commit()
session.close()
Expand Down

0 comments on commit b2fbe28

Please sign in to comment.