Closed mlej8 closed 2 years ago
Any reason why this route is a post?
Reasoning behind this is GET
requests shouldn't modify the state of the backend. However, this route does modify the state of the backend, hence we can either go with POST
or PUT
.
Regarding POST
vs PUT
, I think both would work but maybe PUT
might be better suited as we are modifying the state of something in the backend here.
Just making sure, we don't need to retain the order of the BCI data? (I saw that we were keeping track of order last year) @mlej8
Actually, we do want the order of the data points, good catch! For each batch of points, we want to label each point with their order in the queue, so we also need to update the schema for CollectedData
. We know that we get the points in order from PyLSL since it is using TCP and that guarantees we've gotten the data in order.
@TheFloatingString already started it in his branch for this task, checkout to his branch and rebase main
This route is called by the front end when it highlights a character for the second time.
Create a POST route that receives the following information: (process_id: int)
bci_processes_states[process_id]["queue"]
to the database. SeeNeuroTechX-McGill-2021/software/data_collection_platform/backend/dcp/tasks.py
for reference on how to write to the database.Tagging @HassanKanj16 @TheMatrixMaster to keep frontend in the loop on progress for backend routes