Remove notifications from frontend-core
This commit is contained in:
parent
349b22ba25
commit
1a7e845c56
|
@ -56,11 +56,15 @@
|
|||
const exportApp = async () => {
|
||||
const id = published ? app.prodId : app.devId
|
||||
const url = `/api/backups/export?appId=${id}`
|
||||
|
||||
try {
|
||||
await downloadFile(url, {
|
||||
const downloaded = await downloadFile(url, {
|
||||
excludeRows: !includeInternalTablesRows,
|
||||
encryptPassword: password,
|
||||
})
|
||||
if (!downloaded) {
|
||||
notifications.error("Error exporting the app.")
|
||||
}
|
||||
} catch (error) {
|
||||
notifications.error(error.message || "Error downloading the exported app")
|
||||
}
|
||||
|
|
|
@ -44,7 +44,10 @@ export async function downloadFile(url, body) {
|
|||
body: JSON.stringify(body),
|
||||
})
|
||||
|
||||
if (response.ok) {
|
||||
if (!response.ok) {
|
||||
return false
|
||||
}
|
||||
|
||||
const contentDisposition = response.headers.get("Content-Disposition")
|
||||
|
||||
const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(
|
||||
|
@ -61,7 +64,5 @@ export async function downloadFile(url, body) {
|
|||
link.click()
|
||||
|
||||
URL.revokeObjectURL(url)
|
||||
} else {
|
||||
notifications.error("Error exporting the app.")
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue