James Tombleson
ff4075383a
* added a route to delete subscriptions based on the ID given * added a new route to find a record based on the name and source * added a route to query Discord Web Hooks by Server and Channel names * tested the endpoints and they seem good to test more * updated some routes for subscriptions and formatted files * removed debug file * fixing some panic calls * swag
30 lines
608 B
Go
30 lines
608 B
Go
package routes
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
// GetDiscordQueue
|
|
// @Summary Returns the top 100 entries from the queue to be processed.
|
|
// @Produce application/json
|
|
// @Tags Debug, Discord, Queue
|
|
// @Router /discord/queue [get]
|
|
func (s *Server) GetDiscordQueue(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
res, err := s.Db.ListDiscordQueueItems(*s.ctx, 100)
|
|
if err != nil {
|
|
w.Write([]byte(err.Error()))
|
|
panic(err)
|
|
}
|
|
|
|
bres, err := json.Marshal(res)
|
|
if err != nil {
|
|
w.Write([]byte(err.Error()))
|
|
panic(err)
|
|
}
|
|
|
|
w.Write(bres)
|
|
}
|