phenopolis / phenopolis_genomics_browser

Python API and React frontend for the Phenopolis Genomics Browser
https://dev-live.phenopolis.org
MIT License
31 stars 2 forks source link

fix #307 #308

Closed YuanTian1991 closed 3 years ago

YuanTian1991 commented 3 years ago

It works now, file can be downloaded.

I did not change the backend API for download from "POST" to "GET", merely because the fileKey format is:

PH0000XXXX/somefilename

So if we use "GET" method, like:

download/PH0000XXXX/somefilename

The server would not go to API "download", instead if went to "download/PH0000XXXX/". But it's still possible to use "GET", then the fileKey must be send by param, like a string. I can change that if needed, I just think there is less difference between "GET" and "POST" here.

netlify[bot] commented 3 years ago

:heavy_check_mark: Deploy preview for phenopolis-dev ready!

:hammer: Explore the source changes: 57e4322a6fd730f71221a1e70245f5c36ddeba63

:mag: Inspect the deploy logs: https://app.netlify.com/sites/phenopolis-dev/deploys/5ff7a4aa95bbe90007707788

:sunglasses: Browse the preview: https://deploy-preview-308--phenopolis-dev.netlify.app

IsmailM commented 3 years ago

I think POST is fine :)

PS in flask, if the param contains a slash, you can use the path converter - i.e. "/file_download/<path:file_key>" (see here

@YuanTian1991 - there is a bug: TypeError: Cannot read property 'Contents' of undefined

image

YuanTian1991 commented 3 years ago

That's weird!

I previous indeed found the return of this API is slight differen on dev and localhost, but I did not think much, thought push and merge code should solve it. But this inconsistent still exist.

I think we can try restart the server a bit? Previously it's definitely running well on my computer.

IsmailM commented 3 years ago

Hey, yep - just did a manual deploy - and that seem to have fixed things :)

(Will need to look into why the automated deploy is not always working for us when I get a chance)