client version
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package services
|
||||
|
||||
import "github.com/vaultdrop/backend/entities"
|
||||
|
||||
func (s *Services) CreateFolder(folderName string, destination *entities.Document) (error, *entities.Document) {
|
||||
|
||||
err, directory := entities.NewDocument(folderName, entities.DIRECTORY)
|
||||
if err != nil {
|
||||
return err, nil
|
||||
}
|
||||
|
||||
return nil, directory
|
||||
|
||||
}
|
||||
@@ -1,5 +1,19 @@
|
||||
package services
|
||||
|
||||
func (s *Services) UploadDocument() {
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/vaultdrop/backend/entities"
|
||||
)
|
||||
|
||||
func (s *Services) UploadDocument(file *string, destination *entities.Document) error {
|
||||
|
||||
if canEdit, _ := UserCanEditDocument(s.ConnectedUser, destination); !canEdit {
|
||||
return fmt.Errorf("Can not edit")
|
||||
}
|
||||
|
||||
entities.NewDocument("test", entities.FILE)
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user