1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-06 14:10:06 +00:00

feat: implemented delete file/folder functionality

This commit is contained in:
2022-07-19 22:49:34 +05:00
parent 721165ff12
commit 177675bc89
4 changed files with 70 additions and 13 deletions

View File

@@ -56,6 +56,12 @@ const Studio = () => {
) => {
if (node.relativePath === path) {
removeNodeFromParent(parentNode, path)
// reset selected file path and file path query param
if (
node.relativePath === selectedFilePath ||
selectedFilePath.startsWith(node.relativePath)
)
setSearchParams({})
return true
}
if (Array.isArray(node.children)) {
@@ -81,6 +87,7 @@ const Studio = () => {
selectedFilePath={selectedFilePath}
directoryData={directoryData}
handleSelect={handleSelect}
removeFileFromTree={removeFileFromTree}
/>
<SASjsEditor
selectedFilePath={selectedFilePath}