From e86dd3266a8b4f77025b3f09debb80485f1ebd6d Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Sun, 17 Oct 2021 12:45:12 -0400 Subject: [PATCH] fixes --- internal/api/accounts.go | 1 - internal/repository/postgres_account.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/api/accounts.go b/internal/api/accounts.go index 7dbcd04..9381d2f 100644 --- a/internal/api/accounts.go +++ b/internal/api/accounts.go @@ -91,7 +91,6 @@ func (a *api) upsertAccountsHandler(w http.ResponseWriter, r *http.Request) { laccs, err := a.accountRepo.GetByAPNSToken(ctx, apns) if err != nil { - fmt.Println("accounts by apns") a.errorResponse(w, r, 422, err.Error()) return } diff --git a/internal/repository/postgres_account.go b/internal/repository/postgres_account.go index 5321328..798a204 100644 --- a/internal/repository/postgres_account.go +++ b/internal/repository/postgres_account.go @@ -186,7 +186,7 @@ func (p *postgresAccountRepository) Disassociate(ctx context.Context, acc *domai func (p *postgresAccountRepository) GetByAPNSToken(ctx context.Context, token string) ([]domain.Account, error) { query := ` - SELECT accounts.id, username, accounts.account_id, access_token, refresh_token, expires_at, last_message_id, last_checked_at + SELECT accounts.id, username, accounts.account_id, access_token, refresh_token, expires_at, last_message_id, last_checked_at, last_unstuck_at FROM accounts INNER JOIN devices_accounts ON accounts.id = devices_accounts.account_id INNER JOIN devices ON devices.id = devices_accounts.device_id