Skip to content

Commit

Permalink
Merge pull request #17 from tbabej/fix_removal
Browse files Browse the repository at this point in the history
storage: Fix path to trash directory
  • Loading branch information
ddvk authored Nov 2, 2020
2 parents 25bfc2f + f28bbd8 commit 99c4011
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/storage/fs/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ func (fs *Storage) RemoveDocument(id string) error {
trashDir := fs.Cfg.TrashDir
meta := fmt.Sprintf("%s.metadata", id)
fullPath := path.Join(dataDir, meta)
err := os.Rename(fullPath, path.Join(dataDir, trashDir, meta))
err := os.Rename(fullPath, path.Join(trashDir, meta))
if err != nil {
return err
}
meta = fmt.Sprintf("%s.zip", id)
fullPath = path.Join(dataDir, meta)
err = os.Rename(fullPath, path.Join(dataDir, trashDir, meta))
err = os.Rename(fullPath, path.Join(trashDir, meta))
if err != nil {
return err
}
Expand Down

0 comments on commit 99c4011

Please sign in to comment.