Skip to content

Commit

Permalink
Fixes onSuccess mutation download batch
Browse files Browse the repository at this point in the history
  • Loading branch information
luccasmmg committed Jan 16, 2025
1 parent 98e35b8 commit 7f5cd7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -852,9 +852,7 @@ def download_event_create(context: Context, data_dict: DataDict):

for item in [
["package_id", package_id],
["resources", resources],
["email", email],
["affiliation", affiliation],
]:
if not item[1]:
raise tk.ValidationError("Missing required field " + item[0])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ export function DataFiles({
onError: (err) => {
toast('Failed to send your information', {
type: 'error',
}),
setOpen(false)
})
setOpen(false)
},
})

Expand All @@ -333,15 +333,16 @@ export function DataFiles({
},
{
onSuccess: () => {
toast("You'll receive an email when the file is ready", {
type: 'success',
})
const _data = {
...data,
resources: keys,
package_id: dataset.id ?? '',
}
console.log('Creating download event with data:', _data)
createDownloadEvent.mutate(_data)
toast("You'll receive an email when the file is ready", {
type: 'success',
})
setOpen(false)
},
onError: (err) => {
Expand Down

0 comments on commit 7f5cd7a

Please sign in to comment.