🐛 fix(service.py): import and use process_tags_for_post function to correctly process tags for post request
✨ feat(utils.py): add process_tags_for_post function to handle processing of tags for post request
This commit is contained in:
parent
02c58211cf
commit
d7e2d43409
2 changed files with 8 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ from langflow.services.store.schema import (
|
||||||
ListComponentResponse,
|
ListComponentResponse,
|
||||||
StoreComponentCreate,
|
StoreComponentCreate,
|
||||||
)
|
)
|
||||||
|
from langflow.services.store.utils import process_tags_for_post
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from langflow.services.settings.service import SettingsService
|
from langflow.services.settings.service import SettingsService
|
||||||
|
|
@ -209,6 +210,8 @@ class StoreService(Service):
|
||||||
response = None
|
response = None
|
||||||
if component_dict.get("parent"):
|
if component_dict.get("parent"):
|
||||||
component_dict["parent"] = str(component_dict["parent"])
|
component_dict["parent"] = str(component_dict["parent"])
|
||||||
|
|
||||||
|
component_dict = process_tags_for_post(component_dict)
|
||||||
try:
|
try:
|
||||||
response = httpx.post(
|
response = httpx.post(
|
||||||
self.components_url, headers=headers, json=component_dict
|
self.components_url, headers=headers, json=component_dict
|
||||||
|
|
|
||||||
5
src/backend/langflow/services/store/utils.py
Normal file
5
src/backend/langflow/services/store/utils.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def process_tags_for_post(component_dict):
|
||||||
|
tags = component_dict.pop("tags", None)
|
||||||
|
if tags and all(isinstance(tag, str) for tag in tags):
|
||||||
|
component_dict["tags"] = [{"tags_id": tag} for tag in tags]
|
||||||
|
return component_dict
|
||||||
Loading…
Add table
Add a link
Reference in a new issue