mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-29 07:07: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) {
|
func (a *api) testDeviceHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
ctx := context.Background()
|
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 {
|
if err != nil {
|
||||||
a.logger.WithFields(logrus.Fields{
|
a.logger.WithFields(logrus.Fields{
|
||||||
"err": err,
|
"err": err,
|
||||||
|
@ -45,12 +46,12 @@ func (a *api) testDeviceHandler(w http.ResponseWriter, r *http.Request, ps httpr
|
||||||
stmt := `
|
stmt := `
|
||||||
SELECT username
|
SELECT username
|
||||||
FROM accounts
|
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`
|
WHERE devices_accounts.device_id = $1`
|
||||||
rows, err := a.db.Query(ctx, stmt, d.ID)
|
rows, err := a.db.Query(ctx, stmt, d.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.logger.WithFields(logrus.Fields{
|
a.logger.WithFields(logrus.Fields{
|
||||||
"apns": ps.ByName("apns"),
|
"apns": tok,
|
||||||
"err": err,
|
"err": err,
|
||||||
}).Error("failed to fetch device accounts")
|
}).Error("failed to fetch device accounts")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue