--- post: summary: Download cross-reference results description: Download results of cross-referencing as an Excel file parameters: - in: path name: collection_id required: true schema: type: integer responses: '202':
(collection_id)
| 100 | |
| 101 | @blueprint.route("/api/2/collections/<int:collection_id>/xref.xlsx", methods=["POST"]) |
| 102 | def export(collection_id): |
| 103 | """ |
| 104 | --- |
| 105 | post: |
| 106 | summary: Download cross-reference results |
| 107 | description: Download results of cross-referencing as an Excel file |
| 108 | parameters: |
| 109 | - in: path |
| 110 | name: collection_id |
| 111 | required: true |
| 112 | schema: |
| 113 | type: integer |
| 114 | responses: |
| 115 | '202': |
| 116 | description: Accepted |
| 117 | tags: |
| 118 | - Xref |
| 119 | - Collection |
| 120 | """ |
| 121 | collection = get_db_collection(collection_id, request.authz.READ) |
| 122 | label = "%s - Crossreference results" % collection.label |
| 123 | export = create_export( |
| 124 | operation=SETTINGS.STAGE_EXPORT_XREF, |
| 125 | role_id=request.authz.id, |
| 126 | label=label, |
| 127 | collection=collection, |
| 128 | mime_type=XLSX, |
| 129 | ) |
| 130 | job_id = get_session_id() |
| 131 | queue_task(None, SETTINGS.STAGE_EXPORT_XREF, job_id=job_id, export_id=export.id) |
| 132 | return ("", 202) |
nothing calls this directly
no test coverage detected