expression count get and post action creators

This commit is contained in:
Colin Megill
2017-11-26 23:17:32 -08:00
parent 9b045b1187
commit 7dd3c3db02

View File

@@ -76,9 +76,54 @@ const initialize = () => {
}
}
const requestGeneExpressionCounts = () => {
return (dispatch, getState) => {
dispatch({type: "get expression started"})
fetch(`${globals.API.prefix}${globals.API.version}expression`, {
method: "get",
headers: new Headers({
'accept': 'application/json'
})
})
.then(res => res.json())
.then(
data => dispatch({type: "get expression success", data}),
error => dispatch({type: "get expression error", error})
)
}
}
const ___hardcoded___requestGeneExpressionCountsPOST = () => {
return (dispatch, getState) => {
dispatch({type: "get expression started"})
fetch(`${globals.API.prefix}${globals.API.version}expression`, {
method: "POST",
body: JSON.stringify({
"genelist": [
"AAK1",
"1/2-SBSRNA4",
]
}),
headers: new Headers({
"accept": "application/json",
"Content-Type": "application/json"
})
})
.then(res => res.json())
.then(
data => dispatch({type: "get expression success", data}),
error => dispatch({type: "get expression error", error})
)
}
}
export default {
initialize,
requestCells,
requestGeneExpressionCounts,
___hardcoded___requestGeneExpressionCountsPOST,
attemptCategoricalMetadataSelection,
attemptCategoricalMetadataDeselection
}