[server][api] Trash empty end-point

This commit is contained in:
Abhishek Shroff
2025-04-06 11:05:15 +05:30
parent 8b3dfc8599
commit 87f1599580

View File

@@ -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{})
}