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
+3 -3
View File
@@ -13,8 +13,8 @@ import (
"github.com/vaultdrop/backend/repository"
)
// FileTooLargeError signals an upload above MaxFileSize.
var FileTooLargeError = errors.New("file too large")
// ErrFileTooLarge signals an upload above MaxFileSize.
var ErrFileTooLarge = errors.New("file too large")
// FileDTO serializes exactly as mobile/api/types.ts FileDto.
type FileDTO struct {
@@ -106,7 +106,7 @@ func (s *Resources) SearchFiles(ownerID, q string, page, pageSize int) ([]FileDT
// if metadata persistence fails (e.g. name conflict).
func (s *Resources) Upload(ownerID string, file *multipart.FileHeader, folderID string) (FileDTO, error) {
if file.Size > s.MaxFileSize {
return FileDTO{}, FileTooLargeError
return FileDTO{}, ErrFileTooLarge
}
id := repository.NewID()