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

Move accounts to store

This commit is contained in:
2017-12-07 20:47:55 -05:00
parent bec5152e53
commit 3326c3b292
11 changed files with 211 additions and 183 deletions

View File

@ -29,14 +29,14 @@ func luaContextGetAccounts(L *lua.LState) (map[int64]*models.Account, error) {
return nil, errors.New("Couldn't find User in lua's Context")
}
accounts, err := GetAccounts(tx, user.UserId)
accounts, err := tx.GetAccounts(user.UserId)
if err != nil {
return nil, err
}
account_map = make(map[int64]*models.Account)
for i := range *accounts {
account_map[(*accounts)[i].AccountId] = &(*accounts)[i]
account_map[(*accounts)[i].AccountId] = (*accounts)[i]
}
ctx = context.WithValue(ctx, accountsContextKey, account_map)