feat: implement file renaming

This commit is contained in:
2024-09-17 12:34:35 +07:00
parent cd9a7503b5
commit f52e75db78
10 changed files with 461 additions and 189 deletions

View File

@ -8,6 +8,7 @@ import (
fileHandler "github.com/fossyy/filekeeper/handler/file"
deleteHandler "github.com/fossyy/filekeeper/handler/file/delete"
downloadHandler "github.com/fossyy/filekeeper/handler/file/download"
renameFileHandler "github.com/fossyy/filekeeper/handler/file/rename"
uploadHandler "github.com/fossyy/filekeeper/handler/file/upload"
visibilityHandler "github.com/fossyy/filekeeper/handler/file/visibility"
forgotPasswordHandler "github.com/fossyy/filekeeper/handler/forgotPassword"
@ -131,6 +132,10 @@ func SetupRoutes() *http.ServeMux {
middleware.Auth(visibilityHandler.PUT, w, r)
})
handler.HandleFunc("PATCH /file/{id}", func(w http.ResponseWriter, r *http.Request) {
middleware.Auth(renameFileHandler.PATCH, w, r)
})
handler.HandleFunc("GET /logout", func(w http.ResponseWriter, r *http.Request) {
middleware.Auth(logoutHandler.GET, w, r)
})