mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 13:17:42 +00:00
womp womp
This commit is contained in:
parent
a5b69521c8
commit
c67d7c6882
1 changed files with 4 additions and 3 deletions
|
@ -32,8 +32,9 @@ func (a *api) upsertDeviceHandler(w http.ResponseWriter, r *http.Request, _ http
|
|||
|
||||
func (a *api) testDeviceHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
ctx := context.Background()
|
||||
tok := ps.ByName("apns")
|
||||
|
||||
d, err := a.models.Devices.GetByAPNSToken(ps.ByName("apns"))
|
||||
d, err := a.models.Devices.GetByAPNSToken(tok)
|
||||
if err != nil {
|
||||
a.logger.WithFields(logrus.Fields{
|
||||
"err": err,
|
||||
|
@ -45,12 +46,12 @@ func (a *api) testDeviceHandler(w http.ResponseWriter, r *http.Request, ps httpr
|
|||
stmt := `
|
||||
SELECT username
|
||||
FROM accounts
|
||||
INNER JOIN devices_accounts ON devices.account_id = accounts.id
|
||||
INNER JOIN devices_accounts ON devices_accounts.account_id = accounts.id
|
||||
WHERE devices_accounts.device_id = $1`
|
||||
rows, err := a.db.Query(ctx, stmt, d.ID)
|
||||
if err != nil {
|
||||
a.logger.WithFields(logrus.Fields{
|
||||
"apns": ps.ByName("apns"),
|
||||
"apns": tok,
|
||||
"err": err,
|
||||
}).Error("failed to fetch device accounts")
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue