Skip to content

Commit 78ae226

Browse files
committed
webapp/form: go to tasks on success
1 parent 62ca23f commit 78ae226

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

webapp/src/components/task_creation_form/TaskCreationForm.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ import { storeToRefs } from "pinia";
544544
import { FieldArray, Form } from "vee-validate";
545545
import { toTypedSchema } from "@vee-validate/zod";
546546
import { ref, useTemplateRef, watch } from "vue";
547+
import { useRouter } from "vue-router";
547548
import * as z from "zod";
548549
549550
import * as tf from "@tensorflow/tfjs";
@@ -571,6 +572,7 @@ import FormLabel from "./FormLabel.vue";
571572
import FileSelection from "../dataset_input/FileSelection.vue";
572573
573574
const debug = createDebug("webapp:TaskForm");
575+
const router = useRouter();
574576
const toaster = useToaster();
575577
const { tasks } = storeToRefs(useTasksStore());
576578
@@ -871,13 +873,12 @@ async function onSubmit(form: unknown): Promise<void> {
871873
else toaster.error("An error occured server-side");
872874
return;
873875
}
874-
toaster.success("Task successfully submitted");
875876
876-
if (typeof tasks.value === "string") {
877+
if (typeof tasks.value === "string")
877878
debug("tasks store not available, skipping adding task to it");
878-
return;
879-
}
880-
tasks.value = tasks.value.set(task.id, task);
879+
else tasks.value = tasks.value.set(task.id, task);
880+
881+
router.push("/list");
881882
}
882883
883884
function onInvalidSubmit({

0 commit comments

Comments
 (0)