[server] Remove deprecated API

This commit is contained in:
Neeraj Gupta 2024-03-11 13:05:56 +05:30 committed by Neeraj Gupta
parent fb2abd8afc
commit 28335700e3
3 changed files with 0 additions and 45 deletions

View file

@ -504,7 +504,6 @@ func main() {
privateAPI.GET("/collections/v2/diff", collectionHandler.GetDiffV2)
privateAPI.GET("/collections/file", collectionHandler.GetFile)
privateAPI.GET("/collections/sharees", collectionHandler.GetSharees)
privateAPI.DELETE("/collections/v2/:collectionID", collectionHandler.Trash)
privateAPI.DELETE("/collections/v3/:collectionID", collectionHandler.TrashV3)
privateAPI.POST("/collections/rename", collectionHandler.Rename)
privateAPI.PUT("/collections/magic-metadata", collectionHandler.PrivateMagicMetadataUpdate)

View file

@ -360,18 +360,6 @@ func (h *CollectionHandler) GetSharees(c *gin.Context) {
})
}
// Trash deletes a given collection and move file exclusive to the collection to trash
func (h *CollectionHandler) Trash(c *gin.Context) {
cID, _ := strconv.ParseInt(c.Param("collectionID"), 10, 64)
userID := auth.GetUserID(c.Request.Header)
err := h.Controller.Trash(c, userID, cID)
if err != nil {
handler.Error(c, stacktrace.Propagate(err, ""))
return
}
c.Status(http.StatusOK)
}
func (h *CollectionHandler) TrashV3(c *gin.Context) {
var req ente.TrashCollectionV3Request
if err := c.ShouldBindQuery(&req); err != nil {

View file

@ -619,38 +619,6 @@ func (c *CollectionController) GetSharees(ctx *gin.Context, cID int64, userID in
return sharees, nil
}
// Trash deletes a given collection and files exclusive to the collection
func (c *CollectionController) Trash(ctx *gin.Context, userID int64, cID int64) error {
resp, err := c.AccessCtrl.GetCollection(ctx, &access.GetCollectionParams{
CollectionID: cID,
ActorUserID: userID,
IncludeDeleted: true,
VerifyOwner: true,
})
if err != nil {
return stacktrace.Propagate(err, "")
}
if !resp.Collection.AllowDelete() {
return stacktrace.Propagate(ente.ErrBadRequest, fmt.Sprintf("deleting albums of type %s is not allowed", resp.Collection.Type))
}
if resp.Collection.IsDeleted {
log.WithFields(log.Fields{
"c_id": cID,
"user_id": userID,
}).Warning("Collection is already deleted")
return nil
}
err = c.PublicCollectionCtrl.Disable(ctx, cID)
if err != nil {
return stacktrace.Propagate(err, "failed to disabled public share url")
}
err = c.CollectionRepo.ScheduleDelete(cID, true)
if err != nil {
return stacktrace.Propagate(err, "")
}
return nil
}
// TrashV3 deletes a given collection and based on user input (TrashCollectionV3Request.KeepFiles as FALSE) , it will move all files present in the underlying collection
// to trash.
func (c *CollectionController) TrashV3(ctx *gin.Context, req ente.TrashCollectionV3Request) error {