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

26 lines (25 loc) 686 B
import { useMutation as s } from "@tanstack/react-query"; import { useCreateFolderPath as u } from "./useCreateFolderPath.js"; function h() { const { mutateAsync: n } = u(); return s({ mutationFn: (o) => { const { file: t, rootContainerId: e } = o, r = t.webkitRelativePath; if (r) { const a = r.split("/").slice(0, -1); return n({ rootContainerId: e, path: a }).then((i) => ({ file: t, parentId: i })); } else return Promise.resolve({ file: t, parentId: e }); } }); } export { h as useCreatePathsAndGetParentId }; //# sourceMappingURL=useCreatePathsAndGetParentId.js.map