aboutsummaryrefslogtreecommitdiff
path: root/pkg/view
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/view')
-rw-r--r--pkg/view/album.go3
-rw-r--r--pkg/view/auth.go4
-rw-r--r--pkg/view/filesystem.go2
-rw-r--r--pkg/view/media.go2
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 {