mirror of
https://github.com/pushbits/server.git
synced 2025-06-25 05:47:26 +02:00
get delete messages to work
This commit is contained in:
parent
b392ea1b44
commit
eebc7f7e31
7 changed files with 103 additions and 18 deletions
|
@ -3,6 +3,7 @@ package api
|
|||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -52,6 +53,7 @@ func (h *NotificationHandler) CreateNotification(ctx *gin.Context) {
|
|||
}
|
||||
|
||||
notification.ID = messageID
|
||||
notification.UrlEncodedID = url.QueryEscape(messageID)
|
||||
|
||||
ctx.JSON(http.StatusOK, ¬ification)
|
||||
}
|
||||
|
@ -70,5 +72,9 @@ func (h *NotificationHandler) DeleteNotification(ctx *gin.Context) {
|
|||
Date: time.Now(),
|
||||
}
|
||||
|
||||
h.DP.DeleteNotification(application, &n)
|
||||
if success := successOrAbort(ctx, http.StatusInternalServerError, h.DP.DeleteNotification(application, &n)); !success {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Status(http.StatusOK)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue