Skip to content

Commit

Permalink
review and cleaning of fid-based handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
karnthis committed Sep 26, 2023
1 parent a48bab9 commit 3e76fb0
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions japicore/fidRouteHandling.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,22 @@ func DeleteByFidHandler(fileIo *file_io_handler.FileIoHandler, queue *FileIoQueu
fid := strings.ReplaceAll(id, "/", "_")
fmt.Println(fid)

folder, err := fileIo.DownloadFolder(queue.GetRoot("bulk"))
if err != nil {
jutils.ProcessHttpError("DeleteFile", err, 404, w)
return err
}

err = fileIo.DeleteTargets([]string{fid}, folder)
if err != nil {
jutils.ProcessHttpError("DeleteFile", err, 500, w)
return err
}

message := createJsonResponse("Deletion complete")
// TODO - update after deletion by fid is added to jackalgo

//folder, err := fileIo.DownloadFolder(queue.GetRoot("bulk"))
//if err != nil {
// jutils.ProcessHttpError("DeleteFile", err, 404, w)
// return err
//}
//
//err = fileIo.DeleteTargets([]string{fid}, folder)
//if err != nil {
// jutils.ProcessHttpError("DeleteFile", err, 500, w)
// return err
//}

//message := createJsonResponse("Deletion complete")
message := createJsonResponse("Deletion Not Implemented")
condensedWriteJSON(w, message)
return nil
}
Expand Down

0 comments on commit 3e76fb0

Please sign in to comment.