♻️(backend) remove content from list serializer and introduce excerpt
Including the content field in the list view is not efficient as we need to query the object storage to retrieve it. We want to display an excerpt of the content on the list view so we should store it in database. We let the frontend compute it and save it for us in the new "excerpt" field because we are not supposed to have access to the content (E2EE feature coming)
This commit is contained in:
committed by
Anthony LC
parent
1d0386d9b5
commit
8117866ce7
@@ -152,11 +152,11 @@ class ListDocumentSerializer(BaseResourceSerializer):
|
||||
model = models.Document
|
||||
fields = [
|
||||
"id",
|
||||
"content",
|
||||
"abilities",
|
||||
"created_at",
|
||||
"creator",
|
||||
"depth",
|
||||
"excerpt",
|
||||
"is_favorite",
|
||||
"link_role",
|
||||
"link_reach",
|
||||
@@ -172,6 +172,7 @@ class ListDocumentSerializer(BaseResourceSerializer):
|
||||
"created_at",
|
||||
"creator",
|
||||
"depth",
|
||||
"excerpt",
|
||||
"is_favorite",
|
||||
"link_role",
|
||||
"link_reach",
|
||||
@@ -196,6 +197,7 @@ class DocumentSerializer(ListDocumentSerializer):
|
||||
"created_at",
|
||||
"creator",
|
||||
"depth",
|
||||
"excerpt",
|
||||
"is_favorite",
|
||||
"link_role",
|
||||
"link_reach",
|
||||
|
||||
Reference in New Issue
Block a user