Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Improve performances: Only fetch thumbnail of actives documents

Smaug67398fdf41b14334
diff --git a/backend/services/document.service.go b/backend/services/document.service.go
index a4e6ff7f..cc9047ae 100644
--- a/backend/services/document.service.go
+++ b/backend/services/document.service.go
@@ -21,7 +21,7 @@ func NewDocumentService(db *sql.DB) DocumentService {
func (s *Service) GetAllDocuments(userId types.Snowflake) ([]*models.Document, error) {
var documents = make([]*models.Document, 0)
- rows, err := s.db.Query("SELECT id, name, description, tags, pinned, thumbnail, theme, icon, color, category, parent_id, accessibility, author_id, created_timestamp, updated_timestamp FROM documents WHERE author_id = ? ORDER BY pinned DESC, name", userId)
+ rows, err := s.db.Query("SELECT id, name, description, tags, pinned, theme, icon, color, category, parent_id, accessibility, author_id, created_timestamp, updated_timestamp FROM documents WHERE author_id = ? ORDER BY pinned DESC, name", userId)
if err != nil {
return nil, err
}
@@ -35,7 +35,6 @@ func (s *Service) GetAllDocuments(userId types.Snowflake) ([]*models.Document, e
&document.Description,
&document.Tags,
&document.Pinned,
- &document.Thumbnail,
&document.Theme,
&document.Icon,
&document.Color,