MutateContentBlock with contents

This commit is contained in:
Daniel Egger 2018-09-05 16:38:31 +02:00
parent f7d15b35d6
commit f3a6c0bfe0
1 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,7 @@ class MutateContentBlock(graphene.relay.ClientIDMutation):
id = graphene.ID()
type = graphene.String()
title = graphene.String()
contents = graphene.String()
errors = graphene.List(graphene.String)
content_block = graphene.Field(ContentBlockNode)
@ -24,8 +25,9 @@ class MutateContentBlock(graphene.relay.ClientIDMutation):
id_param = kwargs['id']
type_param = kwargs['type']
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.add_sibling(instance=new_content_block, pos='right')