Skip to content

Commit

Permalink
Fix issues with delete item PR
Browse files Browse the repository at this point in the history
  • Loading branch information
chdastolfo committed Jun 27, 2021
1 parent 0ee5c63 commit d265f00
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
24 changes: 12 additions & 12 deletions monday/query_joins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
# Eventually I will organize this file better but you know what today is not that day.

# ITEM RESOURCE QUERIES
def delete_item_query(item_id):
query = '''
mutation
{
delete_item (item_id: %s)
{
id
}
}''' % (item_id)
return query


def mutate_item_query(board_id, group_id, item_name, column_values,
create_labels_if_missing):
# Monday does not allow passing through non-JSON null values here,
Expand Down Expand Up @@ -139,6 +127,18 @@ def update_item_query(board_id, item_id, column_id, value):
return query


def delete_item_query(item_id):
query = '''
mutation
{
delete_item (item_id: %s)
{
id
}
}''' % (item_id)
return query


def update_multiple_column_values_query(board_id, item_id, column_values):
query = '''mutation
{
Expand Down
10 changes: 9 additions & 1 deletion monday/tests/test_item_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ def test_add_file_to_column_query(self):

def test_delete_item_by_id(self):
query = delete_item_query(item_id=self.item_id)
self.assertIn(str(self.item_id))
self.assertIn(str(self.item_id), query)
self.assertEqual('''
mutation
{
delete_item (item_id: 24)
{
id
}
}'''.replace(" ", ""), query.replace(" ", ""))

0 comments on commit d265f00

Please sign in to comment.