Skip to content

Commit 93a115d

Browse files
authored
Cleaned Upsert APIs (#133)
* added models to create graph_template * fixed spell check * fixed comments by @coderabbitai * added graph create apis * removed extra f * added GrpahTemplate to main * cleaning graphUpdate APIs
1 parent c1a74ed commit 93a115d

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

state-manager/app/models/graph_models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66

77

88
class UpsertGraphTemplateRequest(BaseModel):
9-
name: str = Field(..., description="The name of the graph template")
10-
namespace: str = Field(..., description="The namespace where the graph template will be stored")
119
nodes: List[NodeTemplate] = Field(..., description="List of node templates that define the graph structure")
1210

1311

1412
class UpsertGraphTemplateResponse(BaseModel):
15-
name: str = Field(..., description="The name of the graph template")
16-
namespace: str = Field(..., description="The namespace where the graph template is stored")
1713
nodes: List[NodeTemplate] = Field(..., description="List of node templates that define the graph structure")
1814
created_at: datetime = Field(..., description="Timestamp when the graph template was created")
1915
updated_at: datetime = Field(..., description="Timestamp when the graph template was last updated")

state-manager/app/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async def errored_state_route(namespace_name: str, state_id: str, body: ErroredR
107107
@router.put(
108108
"/graph-templates/{graph_name}",
109109
response_model=UpsertGraphTemplateResponse,
110-
status_code=status.HTTP_200_OK,
110+
status_code=status.HTTP_201_CREATED,
111111
response_description="Graph template upserted successfully"
112112
)
113113
async def upsert_graph_template(namespace_name: str, graph_name: str, body: UpsertGraphTemplateRequest, request: Request, api_key: str = Depends(check_api_key)):

0 commit comments

Comments
 (0)