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:
parent
f14743c94f
commit
6f63d7e687
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user