New directory structure

This commit is contained in:
2017-06-07 23:37:13 +02:00
parent c222a814e4
commit fdbfb22ef5
6 changed files with 32 additions and 15 deletions

View File

@ -1,10 +1,8 @@
package dashboard
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/utils"
)
const maxPosts = 5
@ -24,15 +22,10 @@ func Get(ctx *aero.Context) string {
// }
// return ctx.HTML(components.Dashboard(posts))
userID := ctx.Session().GetString("userId")
if userID != "" {
user, err := arn.GetUser(userID)
if err != nil {
return ctx.Error(http.StatusInternalServerError, "Error fetching user data", err)
}
user := utils.GetUser(ctx)
if user != nil {
return ctx.HTML("Welcome back, " + user.Nick + "!")
}