Post to the API when moving folders and templates

This commit adds logic to:
- take the list of selected folders and templates
- split it into two lists (of folders and templates)
- `POST` that data to the API, to effect the movement of said folders
  and templates

I’ve tried to architect it in such a way that we can easily add more
template ‘operations’ in the future, as we add more forms to the choose
template page.
This commit is contained in:
Chris Hill-Scott
2018-11-08 14:46:18 +00:00
parent 980d66bdaa
commit cdb5b47c4d
10 changed files with 322 additions and 25 deletions

View File

@@ -3242,3 +3242,8 @@ def url_for_endpoint_with_token(endpoint, token):
@pytest.fixture
def mock_get_template_folders(mocker):
return mocker.patch('app.template_folder_api_client.get_template_folders', return_value=[])
@pytest.fixture
def mock_move_to_template_folder(mocker):
return mocker.patch('app.template_folder_api_client.move_to_folder')