File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
backend/src/applications/files Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -427,14 +427,12 @@ export class FilesManager {
427427 // move the resource in db
428428 const trashFileDB : FileDBProps = { ...space . dbFile , inTrash : true }
429429 const dstTrashFileDB : FileDBProps = { ...trashFileDB , path : path . join ( dirName ( trashFileDB . path ) , fileName ( dstTrash . path ) ) }
430- this . filesQueries
431- . moveFiles ( trashFileDB , dstTrashFileDB , dstTrash . isDir )
432- . catch ( ( e : Error ) => this . logger . error ( `${ this . delete . name } - ${ e } ` ) )
430+ await this . filesQueries . moveFiles ( trashFileDB , dstTrashFileDB , dstTrash . isDir )
433431 }
434432 await moveFiles ( space . realPath , trashFile , true )
435433 } else {
436- this . logger . log ( `Unable to find trash path for space - * ${ space . alias } * ( ${ space . id } ) : delete permanently : ${ space . realPath } ` )
437- // todo: define a default trash for external paths
434+ // unsupported case: delete the file (this shouldn't happen )
435+ this . logger . error ( `Unable to find trash path for space - * ${ space . alias } * ( ${ space . id } ) : delete permanently : ${ space . realPath } ` )
438436 forceDeleteInDB = true
439437 await removeFiles ( space . realPath )
440438 }
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ export async function uniqueDatedFilePath(rPath: string): Promise<{ isDir: boole
263263 } else {
264264 const extension = path . extname ( rPath )
265265 const nameWithoutExtension = path . basename ( rPath , extension )
266- return { isDir : true , path : path . join ( path . dirname ( rPath ) , `${ nameWithoutExtension } -${ date } ${ extension } ` ) }
266+ return { isDir : false , path : path . join ( path . dirname ( rPath ) , `${ nameWithoutExtension } -${ date } ${ extension } ` ) }
267267 }
268268}
269269
You can’t perform that action at this time.
0 commit comments