Remove dashboard call and fetch Budgets with login
This commit is contained in:
@ -93,10 +93,16 @@ func (h *Handler) loginPost(c *gin.Context) {
|
||||
|
||||
go h.Service.UpdateLastLogin(context.Background(), user.ID)
|
||||
|
||||
budgets, err := h.Service.GetBudgetsForUser(c.Request.Context(), user.ID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, struct {
|
||||
Token string
|
||||
User postgres.User
|
||||
}{t, user})
|
||||
Token string
|
||||
User postgres.User
|
||||
Budgets []postgres.Budget
|
||||
}{t, user, budgets})
|
||||
}
|
||||
|
||||
type registerInformation struct {
|
||||
@ -143,8 +149,14 @@ func (h *Handler) registerPost(c *gin.Context) {
|
||||
|
||||
go h.Service.UpdateLastLogin(context.Background(), user.ID)
|
||||
|
||||
budgets, err := h.Service.GetBudgetsForUser(c.Request.Context(), user.ID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, struct {
|
||||
Token string
|
||||
User postgres.User
|
||||
}{t, user})
|
||||
Token string
|
||||
User postgres.User
|
||||
Budgets []postgres.Budget
|
||||
}{t, user, budgets})
|
||||
}
|
||||
|
Reference in New Issue
Block a user