MutateContentBlock with contents
This commit is contained in:
parent
f7d15b35d6
commit
f3a6c0bfe0
|
|
@ -11,6 +11,7 @@ class MutateContentBlock(graphene.relay.ClientIDMutation):
|
||||||
id = graphene.ID()
|
id = graphene.ID()
|
||||||
type = graphene.String()
|
type = graphene.String()
|
||||||
title = graphene.String()
|
title = graphene.String()
|
||||||
|
contents = graphene.String()
|
||||||
|
|
||||||
errors = graphene.List(graphene.String)
|
errors = graphene.List(graphene.String)
|
||||||
content_block = graphene.Field(ContentBlockNode)
|
content_block = graphene.Field(ContentBlockNode)
|
||||||
|
|
@ -24,8 +25,9 @@ class MutateContentBlock(graphene.relay.ClientIDMutation):
|
||||||
id_param = kwargs['id']
|
id_param = kwargs['id']
|
||||||
type_param = kwargs['type']
|
type_param = kwargs['type']
|
||||||
title = kwargs['title']
|
title = kwargs['title']
|
||||||
|
contents_data = kwargs['contents']
|
||||||
|
|
||||||
new_content_block = ContentBlock(type=type_param, title=title)
|
new_content_block = ContentBlock(type=type_param, title=title, contents=contents_data)
|
||||||
|
|
||||||
content_block = get_object(ContentBlock, id_param)
|
content_block = get_object(ContentBlock, id_param)
|
||||||
content_block.add_sibling(instance=new_content_block, pos='right')
|
content_block.add_sibling(instance=new_content_block, pos='right')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue