base creation

This commit is contained in:
m
2026-09-03 20:38:47 +02:00
parent 32a61e6a64
commit 80dd164fde
12 changed files with 187 additions and 18 deletions
+29
View File
@@ -0,0 +1,29 @@
package services
import (
"fmt"
"github.com/vaultdrop/backend/entities"
)
func (s *Services) MoveDocumentIntoDocument(from *entities.Document, to *entities.Document) error {
if from.DocumentUUID == nil {
return fmt.Errorf(entities.ERROR_DOCUMENT_NOT_PERCISTED)
}
if canEdit, _ := UserCanEditDocument(s.ConnectedUser, from); canEdit == false {
return fmt.Errorf("You can not edit this folder")
}
if canEdit, _ := UserCanEditDocument(s.ConnectedUser, to); canEdit == false {
return fmt.Errorf("You can not edit this folder")
}
// Check if document exist and move the document into document if is directory
fmt.Println("To implement move to ", to.DocumentUUID)
return nil
}