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