Skip to content

Commit

Permalink
improve listHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
nkonev committed Jan 16, 2025
1 parent 752ce12 commit c856904
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions storage/handlers/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ func (h *FilesHandler) ListHandlerPublic(c echo.Context) error {
}

func (h *FilesHandler) listHandler(c echo.Context, public bool) error {
var userPrincipalDto, _ = c.Get(utils.USER_PRINCIPAL_DTO).(*auth.AuthResult)

chatId, err := utils.ParseInt64(c.Param("chatId"))
if err != nil {
return err
Expand All @@ -385,6 +383,7 @@ func (h *FilesHandler) listHandler(c echo.Context, public bool) error {
var userId *int64
var overrideChatId, overrideMessageId int64
if !public {
var userPrincipalDto, _ = c.Get(utils.USER_PRINCIPAL_DTO).(*auth.AuthResult)
if userPrincipalDto == nil {
return c.NoContent(http.StatusUnauthorized)
} else {
Expand Down

0 comments on commit c856904

Please sign in to comment.