feat: download completed export jobs
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-10 01:31:09 -04:00
parent ad8f675f5e
commit ec322df25c
5 changed files with 34 additions and 0 deletions
+10
View File
@@ -55,6 +55,7 @@ const inventory = ref([]);
const selectedInventoryIds = ref([]);
const inventoryTags = ref("");
const exportStatus = ref("");
const exportJobId = ref("");
const listings = ref([]);
const sales = ref([]);
const acquisitions = ref([]);
@@ -262,6 +263,7 @@ async function enqueueInventoryExport() {
exportStatus.value = "Starting export...";
try {
const job = await enqueueAdminInventoryExport(csrfToken());
exportJobId.value = job.id;
const completed = await getAdminInventoryExportJob(job.id);
exportStatus.value = `Export ${completed.status.toLowerCase()}.`;
} catch (requestError) {
@@ -542,6 +544,14 @@ onMounted(load);
Queue JSON export
</button>
<span v-if="exportStatus" role="status">{{ exportStatus }}</span>
<a
v-if="exportJobId && exportStatus === 'Export completed.'"
class="button button--secondary"
:href="`/api/v1/admin/exports/jobs/${exportJobId}/download`"
download="inventory.json"
>
Download queued export
</a>
</p>
<p v-if="isLoading" class="state state--loading" role="status">
Loading inventory...