Skip to content

Commit

Permalink
fix: prevent unnecessary calls
Browse files Browse the repository at this point in the history
  • Loading branch information
henrychoy committed Oct 8, 2024
1 parent 370895f commit 9eccb7e
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/frontend/src/views/CreateJob.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,21 @@
onMounted(async () => {
if(store.savedForms.jobs[route.params.id]) {
job.value = store.savedForms.jobs[route.params.id]
try {
await api.getItem('queues', job.value.queue.id)
} catch(err) {
job.value.queue = ''
console.warn(err)
if(job.value.queue && job.value.queue.id) {
try {
await api.getItem('queues', job.value.queue.id)
} catch(err) {
job.value.queue = ''
console.warn(err)
}
}
try {
await api.getItem('entrypoints', job.value.entrypoint.id)
} catch(err) {
job.value.entrypoint = ''
console.warn(err)
if(job.value.entrypoint && job.value.entrypoint.id) {
try {
await api.getItem('entrypoints', job.value.entrypoint.id)
} catch(err) {
job.value.entrypoint = ''
console.warn(err)
}
}
basicInfoForm.value.reset()
showReturnDialog.value = true
Expand Down

0 comments on commit 9eccb7e

Please sign in to comment.