Skip to content

Commit

Permalink
Made username a config parameter instead of ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
fimtitzgerald committed Jul 24, 2018
1 parent 2d74238 commit 40a3b58
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 3 additions & 2 deletions zendesk/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import (
"log"
"net/http"
"os"

"github.com/senorprogrammer/wtf/wtf"
)

type Resource struct {
//Headers http.Header
Response interface{}
Raw string
}

var a = os.Getenv("ZENDESK_API")
var username = os.Getenv("ZENDESK_USERNAME")
var subdomain = os.Getenv("ZENDESK_SUBDOMAIN")
var baseURL = fmt.Sprintf("https://%v.zendesk.com/api/v2", subdomain)

Expand Down Expand Up @@ -48,6 +48,7 @@ func api(key string, meth string, path string, params string) (*Resource, error)

req.Header.Add("Content-Type", "application/json")

username := wtf.Config.UString("wtf.mods.zendesk.username")
apiUser := fmt.Sprintf("%v/token", username)
req.SetBasicAuth(apiUser, key)

Expand Down
3 changes: 0 additions & 3 deletions zendesk/tickets.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package zendesk

import (
"encoding/json"
//"fmt"
"log"
)

Expand Down Expand Up @@ -50,8 +49,6 @@ type Ticket struct {
Fields interface{} `json:"fields"`
}

//var a = os.Getenv("ZENDESK_API")

func listTickets(pag ...string) (*TicketArray, error) {

TicketStruct := &TicketArray{}
Expand Down
2 changes: 0 additions & 2 deletions zendesk/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ func (widget *Widget) textContent(items []Ticket) string {

str := ""
for _, data := range items {
//str = items[i]
//str = fmt.Sprintf(data.Id)
str = str + widget.format(data)
}

Expand Down

0 comments on commit 40a3b58

Please sign in to comment.