1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-27 18:50:05 +00:00

fix(web-drive): upon delete remove entry of deleted file from directory tree in sidebar

This commit is contained in:
2022-03-16 18:52:00 +00:00
parent fa627aabf9
commit fb77d99177
2 changed files with 44 additions and 2 deletions

View File

@@ -11,7 +11,12 @@ import Button from '@mui/material/Button'
import Toolbar from '@mui/material/Toolbar'
import CircularProgress from '@mui/material/CircularProgress'
const Main = (props: any) => {
type Props = {
selectedFilePath: string
removeFileFromTree: (path: string) => void
}
const Main = (props: Props) => {
const baseUrl = window.location.origin
const [isLoading, setIsLoading] = useState(false)
@@ -45,6 +50,7 @@ const Main = (props: any) => {
.delete(`/SASjsApi/drive/file?_filePath=${filePath}`)
.then((res) => {
setFileContent('')
props.removeFileFromTree(filePath)
window.history.pushState('', '', `${baseUrl}/#/SASjsDrive`)
})
.catch((err) => {