From fb01cf91bc71ef0fc3302b2a6bbdf3af5c375843 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Sat, 4 Jun 2022 10:58:53 -0400 Subject: [PATCH] stop notifying old server --- internal/api/accounts.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/internal/api/accounts.go b/internal/api/accounts.go index 2764e81..2bfca22 100644 --- a/internal/api/accounts.go +++ b/internal/api/accounts.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "net/http" - "strings" "time" "github.com/gorilla/mux" @@ -188,22 +187,6 @@ func (a *api) upsertAccountsHandler(w http.ResponseWriter, r *http.Request) { _ = a.accountRepo.Disassociate(ctx, &acc, &dev) } - body := fmt.Sprintf(`{"apns_token": "%s"}`, apns) - req, err := http.NewRequestWithContext(ctx, "POST", "https://apollopushserver.xyz/api/new-server-addition", strings.NewReader(body)) - if err != nil { - a.logger.Error("could not setup request to disassociate from legacy api", zap.Error(err), zap.String("apns", apns)) - w.WriteHeader(http.StatusOK) - return - } - - req.Header.Set("Authorization", "Bearer 98g5j89aurqwfcsp9khlnvgd38fa15") - resp, _ := a.httpClient.Do(req) - if err != nil { - a.logger.Error("failed to remove from old notification server", zap.Error(err), zap.String("apns", apns)) - return - } - resp.Body.Close() - w.WriteHeader(http.StatusOK) }