mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-05 19:21:23 -06:00
[server][api] Trash empty end-point
This commit is contained in:
@@ -12,6 +12,7 @@ func SetupRoutes(r *gin.RouterGroup) {
|
||||
group := r.Group("/trash")
|
||||
|
||||
group.GET("/list", handleListRequest)
|
||||
group.POST("/empty", handleEmptyRequest)
|
||||
}
|
||||
|
||||
type trashListResponse struct {
|
||||
@@ -37,3 +38,12 @@ func handleListRequest(c *gin.Context) {
|
||||
|
||||
c.JSON(200, r)
|
||||
}
|
||||
|
||||
func handleEmptyRequest(c *gin.Context) {
|
||||
fs := auth.GetFileSystem(c)
|
||||
_, err := fs.TrashEmpty()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
c.JSON(200, gin.H{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user