mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-30 18:48:12 +08:00
Parametrization
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
import { loadUserColorConfig } from "../util/stateManager/colorHelpers";
|
||||
import * as selnActions from "./selection";
|
||||
import * as annoActions from "./annotation";
|
||||
import * as spatialActions from "./spatial";
|
||||
import * as viewActions from "./viewStack";
|
||||
import * as embActions from "./embedding";
|
||||
import * as genesetActions from "./geneset";
|
||||
@@ -272,4 +273,5 @@ export default {
|
||||
genesetDelete: genesetActions.genesetDelete,
|
||||
genesetAddGenes: genesetActions.genesetAddGenes,
|
||||
genesetDeleteGenes: genesetActions.genesetDeleteGenes,
|
||||
requestSpatialMetadata: spatialActions.requestSpatialMetadata,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import * as globals from "../globals";
|
||||
|
||||
export const requestSpatialMetadata = () => async (dispatch) => {
|
||||
dispatch({ type: "request spatial metadata started" });
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${globals.API.prefix}${globals.API.version}spatial/meta`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: new Headers({
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
}),
|
||||
credentials: "include",
|
||||
}
|
||||
);
|
||||
|
||||
if (!res.ok || res.headers.get("Content-Type") !== "application/json") {
|
||||
return null; // TODO need a dispatch //dispatchDiffExpErrors(dispatch, res);
|
||||
}
|
||||
|
||||
const response = await res.json();
|
||||
|
||||
/* then send the success case action through */
|
||||
return dispatch({
|
||||
type: "request spatial metadata success",
|
||||
data: response,
|
||||
});
|
||||
} catch (error) {
|
||||
return dispatch({
|
||||
type: "request spatial metadata error",
|
||||
error,
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user