synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
26 lines (25 loc) • 686 B
JavaScript
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