1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 12:48: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

@ -5,6 +5,7 @@ package handlers
import (
"errors"
"github.com/aclindsa/moneygo/internal/models"
"github.com/aclindsa/moneygo/internal/store"
"github.com/aclindsa/moneygo/internal/store/db"
"log"
"net/http"
@ -77,7 +78,7 @@ func ImportGetCreateSecurity(tx *db.Tx, userid int64, security *models.Security)
return security, nil
}
securities, err := tx.FindMatchingSecurities(userid, security)
securities, err := tx.FindMatchingSecurities(security)
if err != nil {
return nil, err
}
@ -215,7 +216,7 @@ func SecurityHandler(r *http.Request, context *Context) ResponseWriterWriter {
}
err = context.Tx.DeleteSecurity(security)
if _, ok := err.(db.SecurityInUseError); ok {
if _, ok := err.(store.SecurityInUseError); ok {
return NewError(7 /*In Use Error*/)
} else if err != nil {
log.Print(err)