Update delete mutation signature
This commit is contained in:
parent
6ce2f297d7
commit
866e6f718c
|
|
@ -137,7 +137,7 @@ class UpdateRoomEntry(MutateRoomEntry):
|
|||
|
||||
class DeleteRoomEntry(relay.ClientIDMutation):
|
||||
class Input:
|
||||
id = graphene.ID(required=True)
|
||||
slug = graphene.String(required=True)
|
||||
|
||||
success = graphene.Boolean()
|
||||
room_slug = graphene.String()
|
||||
|
|
@ -146,8 +146,8 @@ class DeleteRoomEntry(relay.ClientIDMutation):
|
|||
|
||||
@classmethod
|
||||
def mutate_and_get_payload(cls, root, info, **kwargs):
|
||||
id = kwargs.get('id')
|
||||
room_entry = get_object(RoomEntry, id)
|
||||
slug = kwargs.get('slug')
|
||||
room_entry = RoomEntry.objects.get(slug=slug)
|
||||
if room_entry.author.pk != info.context.user.pk:
|
||||
raise Exception('You are not the owner of this room entry')
|
||||
room_id = to_global_id('RoomNode', room_entry.room.pk)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class RoomEntryMutationsTestCase(SkillboxTestCase):
|
|||
|
||||
result = self.client.execute(mutation, variables={
|
||||
'input': {
|
||||
'id': to_global_id('RoomEntryNode', self.room_entry.pk)
|
||||
'slug': self.room_entry.slug
|
||||
}
|
||||
})
|
||||
self.assertIsNone(result.get('errors'))
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ type DeleteProjectPayload {
|
|||
}
|
||||
|
||||
input DeleteRoomEntryInput {
|
||||
id: ID!
|
||||
slug: String!
|
||||
clientMutationId: String
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue