Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[epociask/issue-160-slack-fix] Addressing PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethen Pociask committed Oct 20, 2023
1 parent 5b124d0 commit 6e20b7d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/client/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import (
"github.com/base-org/pessimism/internal/logging"
)

const (
msgOK = "ok"
)

type SlackClient interface {
AlertClient
}
Expand Down Expand Up @@ -82,7 +86,7 @@ type SlackAPIResponse struct {
// ToAlertResponse ... Converts a slack API response to an alert API response
func (a *SlackAPIResponse) ToAlertResponse() *AlertAPIResponse {
status := core.SuccessStatus
if a.Message != "ok" {
if a.Message != msgOK {
status = core.FailureStatus
}

Expand Down Expand Up @@ -132,10 +136,10 @@ func (sc slackClient) PostEvent(ctx context.Context, event *AlertEventTrigger) (
}

// 3.c. validate response body
if string(bytes) == "ok" {
if string(bytes) == msgOK {
return &AlertAPIResponse{
Status: core.SuccessStatus,
Message: "ok",
Message: msgOK,
}, nil
}

Expand Down

0 comments on commit 6e20b7d

Please sign in to comment.