mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-20 16:13:24 -04:00
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:
@@ -331,3 +331,14 @@ class Service():
|
||||
self.get_templates(template_type, template_folder_id) +
|
||||
self.get_template_folders(template_folder_id)
|
||||
)
|
||||
|
||||
def move_to_folder(self, ids_to_move, move_to):
|
||||
|
||||
ids_to_move = set(ids_to_move)
|
||||
|
||||
template_folder_api_client.move_to_folder(
|
||||
service_id=self.id,
|
||||
folder_id=move_to,
|
||||
template_ids=ids_to_move & self.all_template_ids,
|
||||
folder_ids=ids_to_move & self.all_template_folder_ids,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user