Fix send cancel request
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { router, useForm } from '@inertiajs/vue3';
|
import { useForm } from '@inertiajs/vue3';
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
@@ -190,15 +190,17 @@ const emit = defineEmits(['update:selectedDataset', 'update:trainingId']);
|
|||||||
async function cancelTraining() {
|
async function cancelTraining() {
|
||||||
form.cancel();
|
form.cancel();
|
||||||
|
|
||||||
router.post(
|
await fetch(cancel().url, {
|
||||||
cancel().url,
|
method: 'POST',
|
||||||
{
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
credentials: 'same-origin',
|
||||||
|
body: JSON.stringify({
|
||||||
training_id: trainingId.value,
|
training_id: trainingId.value,
|
||||||
},
|
}),
|
||||||
{
|
});
|
||||||
preserveScroll: true,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(selectedDatasetCopy, (newValue) => {
|
watch(selectedDatasetCopy, (newValue) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user