Sfoglia il codice sorgente

enhance(cosy): permanently delete

0xJacky 1 anno fa
parent
commit
5a19133254
2 ha cambiato i file con 3 aggiunte e 4 eliminazioni
  1. 2 2
      api/cosy/delete.go
  2. 1 2
      api/notification/notification.go

+ 2 - 2
api/cosy/delete.go

@@ -6,9 +6,9 @@ import (
 	"net/http"
 )
 
-func (c *Ctx[T]) PermanentlyDelete() *Ctx[T] {
+func (c *Ctx[T]) PermanentlyDelete() {
 	c.permanentlyDelete = true
-	return c
+	c.Destroy()
 }
 
 func (c *Ctx[T]) Destroy() {

+ 1 - 2
api/notification/notification.go

@@ -31,8 +31,7 @@ func GetList(c *gin.Context) {
 
 func Destroy(c *gin.Context) {
 	cosy.Core[model.Notification](c).
-		PermanentlyDelete().
-		Destroy()
+		PermanentlyDelete()
 }
 
 func DestroyAll(c *gin.Context) {