This commit is contained in:
parent
8cd0c8ea4c
commit
20eba36c65
|
@ -1,6 +1,6 @@
|
|||
#### [0.4.11] - 2025-02-12
|
||||
- `create_draft` resolver requires draft_id fixed
|
||||
- `create_draft` resolver defaults body field to empty string
|
||||
- `create_draft` resolver defaults body and title fields to empty string
|
||||
|
||||
|
||||
#### [0.4.9] - 2025-02-09
|
||||
|
|
|
@ -67,7 +67,7 @@ async def create_draft(_, info, draft_input):
|
|||
Args:
|
||||
info: GraphQL context
|
||||
draft_input (dict): Draft data including optional fields:
|
||||
- title (str)
|
||||
- title (str, required) - заголовок черновика
|
||||
- body (str, required) - текст черновика
|
||||
- slug (str)
|
||||
- etc.
|
||||
|
@ -97,6 +97,9 @@ async def create_draft(_, info, draft_input):
|
|||
if "body" not in draft_input or not draft_input["body"]:
|
||||
draft_input["body"] = "" # Пустая строка вместо NULL
|
||||
|
||||
if "title" not in draft_input or not draft_input["title"]:
|
||||
draft_input["title"] = "" # Пустая строка вместо NULL
|
||||
|
||||
try:
|
||||
with local_session() as session:
|
||||
# Remove id from input if present since it's auto-generated
|
||||
|
|
Loading…
Reference in New Issue
Block a user