🐛(backend) fix issues with conversion microservice integration
Minor adjustments were needed after working in parallel on two PRs. The microservice now accepts an API key without requiring it as a Bearer token. A mistake in reading the microservice response was corrected after refactoring the serializer to delegate logic to the converter microservice.
This commit is contained in:
committed by
aleb_the_flash
parent
dc9b375ff5
commit
52534db3e1
@@ -275,7 +275,7 @@ class ServerCreateDocumentSerializer(serializers.Serializer):
|
||||
language = user.language or language
|
||||
|
||||
try:
|
||||
converter_response = YdocConverter().convert_markdown(
|
||||
document_content = YdocConverter().convert_markdown(
|
||||
validated_data["content"]
|
||||
)
|
||||
except ConversionError as err:
|
||||
@@ -283,7 +283,7 @@ class ServerCreateDocumentSerializer(serializers.Serializer):
|
||||
|
||||
document = models.Document.objects.create(
|
||||
title=validated_data["title"],
|
||||
content=converter_response["content"],
|
||||
content=document_content,
|
||||
creator=user,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user