Browse Source

Merge pull request #3546 from nocodb/fix/3542-import-data

fix(gui): avoid unnecessary upload api call from upload component
pull/3547/head
Pranav C 2 years ago committed by GitHub
parent
commit
f7ff7e26a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      packages/nc-gui/components/dlg/QuickImport.vue
  2. 4
      packages/nc-gui/pages/signup/[[token]].vue

12
packages/nc-gui/components/dlg/QuickImport.vue

@ -270,6 +270,17 @@ function getAdapter(name: string, val: any) {
defineExpose({
handleChange,
})
/** a workaround to override default antd upload api call */
const customReqCbk = (customReqArgs: { file: any; onSuccess: () => void }) => {
importState.fileList.forEach((f) => {
if (f.uid === customReqArgs.file.uid) {
f.status = 'done'
handleChange({ file: f, fileList: importState.fileList })
}
})
customReqArgs.onSuccess()
}
</script>
<template>
@ -308,6 +319,7 @@ defineExpose({
:accept="importMeta.acceptTypes"
:max-count="1"
list-type="picture"
:custom-request="customReqCbk"
@change="handleChange"
@reject="rejectDrop"
>

4
packages/nc-gui/pages/signup/[[token]].vue

@ -78,9 +78,7 @@ async function signUp() {
token: route.params.token,
}
if (subscribe.value) {
data.ignore_subscribe = !subscribe.value
}
data.ignore_subscribe = !subscribe.value
api.auth
.signup(data)

Loading…
Cancel
Save