1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Desired status can be set from config

This commit is contained in:
Tim Fitzgerald 2018-07-25 09:51:15 -07:00
parent f14743c94f
commit 6f63d7e687
2 changed files with 4 additions and 3 deletions

View File

@ -66,14 +66,14 @@ func listTickets(pag ...string) (*TicketArray, error) {
}
func newTickets() ([]Ticket, error) {
func newTickets(ticketStatus string) ([]Ticket, error) {
newTickets := []Ticket{}
tickets, err := listTickets()
if err != nil {
log.Fatal(err)
}
for _, Ticket := range tickets.Tickets {
if Ticket.Status == "new" && Ticket.Status != "closed" && Ticket.Status != "solved" {
if Ticket.Status == ticketStatus && Ticket.Status != "closed" && Ticket.Status != "solved" {
newTickets = append(newTickets, Ticket)
}
}

View File

@ -25,7 +25,8 @@ func NewWidget() *Widget {
/* -------------------- Exported Functions -------------------- */
func (widget *Widget) Refresh() {
tickets, err := newTickets()
ticketStatus := wtf.Config.UString("wtf.mods.zendesk.status")
tickets, err := newTickets(ticketStatus)
if err != nil {
log.Fatal(err)
}