add version and translate all pages

This commit is contained in:
m
2026-09-15 13:57:57 +02:00
parent 4659f3abc5
commit 339d55d92f
19 changed files with 205 additions and 70 deletions
+7 -6
View File
@@ -1,6 +1,7 @@
package service
import (
"errors"
"fmt"
"github.com/vaultdrop/backend/models"
@@ -9,19 +10,19 @@ import (
func (s *Services) MoveDocumentIntoDocument(from *models.Document, to *models.Document) error {
if from.UUID == nil {
return fmt.Errorf(models.ERROR_DOCUMENT_NOT_PERCISTED)
return errors.New(models.ERROR_DOCUMENT_NOT_PERCISTED)
}
if to.Type != models.DIRECTORY {
return fmt.Errorf("The destination document must be a directory")
return errors.New("the destination document must be a directory")
}
if canEdit, _ := UserCanEditDocument(s.ConnectedUser, from); canEdit == false {
return fmt.Errorf("You can not edit this folder")
if canEdit, _ := UserCanEditDocument(s.ConnectedUser, from); !canEdit {
return errors.New("you cannot edit this folder")
}
if canEdit, _ := UserCanEditDocument(s.ConnectedUser, to); canEdit == false {
return fmt.Errorf("You can not edit this folder")
if canEdit, _ := UserCanEditDocument(s.ConnectedUser, to); !canEdit {
return errors.New("you cannot edit this folder")
}
// Check if document exist and move the document into document if is directory