add version and translate all pages
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user