diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-19 16:50:04 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-19 16:50:04 +0200 |
commit | 2857052a38c9ad2c5946f6101bf7d37d63235df8 (patch) | |
tree | 8c80c37560336171b5b0e550a0244ebbcfc1e160 /pkg/view | |
parent | 6531b1c0a720a63ee3127f9a09f14ba861838b01 (diff) | |
download | lens-2857052a38c9ad2c5946f6101bf7d37d63235df8.tar.gz lens-2857052a38c9ad2c5946f6101bf7d37d63235df8.tar.bz2 lens-2857052a38c9ad2c5946f6101bf7d37d63235df8.zip |
fix: Fix various linting error
Diffstat (limited to 'pkg/view')
-rw-r--r-- | pkg/view/album.go | 3 | ||||
-rw-r--r-- | pkg/view/auth.go | 4 | ||||
-rw-r--r-- | pkg/view/filesystem.go | 2 | ||||
-rw-r--r-- | pkg/view/media.go | 2 |
4 files changed, 5 insertions, 6 deletions
diff --git a/pkg/view/album.go b/pkg/view/album.go index 9e70b4b..b19e381 100644 --- a/pkg/view/album.go +++ b/pkg/view/album.go @@ -30,7 +30,7 @@ func NewAlbumView( func (self *AlbumView) Index(w http.ResponseWriter, r *http.Request) error { p := getPagination(r) - token := ext.GetTokenFromCtx(w, r) + token := ext.GetTokenFromCtx(r) // TODO: optmize call, GetPathFromUserID may no be necessary userPath, err := self.userRepository.GetPathFromUserID(r.Context(), token.UserID) @@ -67,7 +67,6 @@ func (self *AlbumView) Index(w http.ResponseWriter, r *http.Request) error { if err != nil { return err } - } medias, err := self.mediaRepository.List(r.Context(), p) diff --git a/pkg/view/auth.go b/pkg/view/auth.go index 2a4b95e..1b87235 100644 --- a/pkg/view/auth.go +++ b/pkg/view/auth.go @@ -19,7 +19,7 @@ func NewAuthView(userController *service.AuthController) *AuthView { } } -func (v *AuthView) LoginView(w http.ResponseWriter, r *http.Request) error { +func (v *AuthView) LoginView(w http.ResponseWriter, _ *http.Request) error { templates.WritePageTemplate(w, &templates.LoginPage{}) return nil } @@ -72,7 +72,7 @@ func Index(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/login", http.StatusTemporaryRedirect) } -func (v *AuthView) InitialRegisterView(w http.ResponseWriter, r *http.Request) error { +func (v *AuthView) InitialRegisterView(w http.ResponseWriter, _ *http.Request) error { templates.WritePageTemplate(w, &templates.RegisterPage{}) return nil } diff --git a/pkg/view/filesystem.go b/pkg/view/filesystem.go index d49ad4f..24f0ce6 100644 --- a/pkg/view/filesystem.go +++ b/pkg/view/filesystem.go @@ -34,7 +34,7 @@ func NewFileSystemView( func (self *FileSystemView) Index(w http.ResponseWriter, r *http.Request) error { var ( pathValue = r.FormValue("path") - token = ext.GetTokenFromCtx(w, r) + token = ext.GetTokenFromCtx(r) ) page, err := self.fsService.GetPage(r.Context(), token.UserID, pathValue) diff --git a/pkg/view/media.go b/pkg/view/media.go index f490ce1..3041998 100644 --- a/pkg/view/media.go +++ b/pkg/view/media.go @@ -71,7 +71,7 @@ func NewMediaView( func (self *MediaView) Index(w http.ResponseWriter, r *http.Request) error { p := getPagination(r) - token := ext.GetTokenFromCtx(w, r) + token := ext.GetTokenFromCtx(r) userPath, err := self.userRepository.GetPathFromUserID(r.Context(), token.UserID) if err != nil { |