ticket close listener
This commit is contained in:
parent
323a378315
commit
8ca265837f
@ -57,6 +57,12 @@ func SendMessage(ctx *gin.Context) {
|
||||
ticket := <-ticketChan
|
||||
exists := ticket != table.Ticket{}
|
||||
|
||||
// Verify that the user has permission to be here
|
||||
if ticket.Guild != guildId {
|
||||
ctx.Redirect(302, fmt.Sprintf("/manage/%s/tickets", guildIdStr))
|
||||
return
|
||||
}
|
||||
|
||||
contentType := discord.ApplicationJson
|
||||
|
||||
if exists {
|
||||
|
@ -67,6 +67,12 @@ func TicketViewHandler(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// Verify that the user has permission to be here
|
||||
if ticket.Guild != guildId {
|
||||
ctx.Redirect(302, fmt.Sprintf("/manage/%s/tickets", guildIdStr))
|
||||
return
|
||||
}
|
||||
|
||||
// Get messages
|
||||
var messages []objects.Message
|
||||
// We want to show users error messages so they can report them
|
||||
|
@ -53,6 +53,8 @@ func LogViewHandler(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
uuid := ctx.Param("uuid")
|
||||
|
||||
// Doesn't need guild = ticket.guild check, since we select where uuid=uuid and guild=guild
|
||||
cdnUrl := table.GetCdnUrl(guildId, uuid)
|
||||
|
||||
if cdnUrl == "" {
|
||||
|
@ -55,6 +55,7 @@ func StartServer() {
|
||||
|
||||
router.GET("/manage/:id/tickets", manage.TicketListHandler)
|
||||
router.GET("/manage/:id/tickets/view/:uuid", manage.TicketViewHandler)
|
||||
router.POST("/manage/:id/tickets/view/:uuid/close", manage.TicketCloseHandler)
|
||||
router.POST("/manage/:id/tickets/view/:uuid", manage.SendMessage)
|
||||
router.GET("/webchat", manage.WebChatWs)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user