UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

25 lines (24 loc) 919 B
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