synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
25 lines (24 loc) • 919 B
JavaScript
import d from "./useMergeGridWithTable.js";
import y from "./useMergeGridWithRecordSet.js";
import { EntityType as i } from "@sage-bionetworks/synapse-client";
import { useMutation as f } from "@tanstack/react-query";
import { useSynchronizeGridSession as p } from "../../synapse-queries/grid/useGridSession.js";
function g(a) {
const o = p(), n = d(), s = y();
return f({
...a,
mutationFn: async ({ gridSessionId: t, sourceEntityId: c, sourceEntityType: e }) => {
const m = e === i.entityview, u = e === i.recordset;
return m ? { type: "entityview", data: await o.mutateAsync({
gridSessionId: t
}) } : u ? { type: "recordset", data: await s.mutateAsync({ gridSessionId: t }) } : { type: "table", data: await n.mutateAsync({
gridSessionId: t,
sourceEntityId: c
}) };
}
});
}
export {
g as default
};
//# sourceMappingURL=useMergeGridWithSource.js.map