From 4b7af2e16a833de2551d77807d50c473eee05238 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 13 Jun 2023 12:45:57 +0100 Subject: [PATCH] Pass password --- .../src/components/start/ExportAppModal.svelte | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/start/ExportAppModal.svelte b/packages/builder/src/components/start/ExportAppModal.svelte index 8ee2967df9..5afa133218 100644 --- a/packages/builder/src/components/start/ExportAppModal.svelte +++ b/packages/builder/src/components/start/ExportAppModal.svelte @@ -19,7 +19,7 @@ $: validation.observe("password", password) const Step = { CONFIG: "config", SET_PASSWORD: "set_password" } - let currentStep = Step.SET_PASSWORD + let currentStep = Step.CONFIG $: exportButtonText = published ? "Export published" : "Export latest" $: stepConfig = { @@ -44,16 +44,20 @@ if (!$validation.valid) { return false } - exportApp() + exportApp(password) }, isValid: $validation.valid, }, } - const exportApp = () => { + const exportApp = password => { const id = published ? app.prodId : app.devId const appName = encodeURIComponent(app.name) - window.location = `/api/backups/export?appId=${id}&appname=${appName}&excludeRows=${!includeInternalTablesRows}` + let url = `/api/backups/export?appId=${id}&appname=${appName}&excludeRows=${!includeInternalTablesRows}` + if (password) { + url += `&encryptPassword=${password}` + } + window.location = url }