1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-02 20:28:38 -04:00

Begin splitting models from handlers with User

This commit is contained in:
2017-12-02 06:14:47 -05:00
parent 382d6ad434
commit e70be1647c
11 changed files with 82 additions and 66 deletions

View File

@ -3,6 +3,7 @@ package handlers
import (
"context"
"errors"
"github.com/aclindsa/moneygo/internal/models"
"github.com/yuin/gopher-lua"
)
@ -20,7 +21,7 @@ func luaContextGetSecurities(L *lua.LState) (map[int64]*Security, error) {
security_map, ok = ctx.Value(securitiesContextKey).(map[int64]*Security)
if !ok {
user, ok := ctx.Value(userContextKey).(*User)
user, ok := ctx.Value(userContextKey).(*models.User)
if !ok {
return nil, errors.New("Couldn't find User in lua's Context")
}
@ -50,7 +51,7 @@ func luaContextGetDefaultCurrency(L *lua.LState) (*Security, error) {
ctx := L.Context()
user, ok := ctx.Value(userContextKey).(*User)
user, ok := ctx.Value(userContextKey).(*models.User)
if !ok {
return nil, errors.New("Couldn't find User in lua's Context")
}