redirect to workout after upload
Gitea Actions Demo / build_and_push (push) Successful in 1m20s Details

This commit is contained in:
artem 2024-11-14 20:06:30 +03:00
parent ced84d69ec
commit 2bd67ec6b4
1 changed files with 4 additions and 0 deletions

View File

@ -14,9 +14,11 @@ import { AxiosResponse, AxiosInstance } from "axios";
import { inject } from 'vue'
import { VaFileUpload } from "vuestic-ui";
import { useToast } from "vuestic-ui/web-components";
import { useRouter } from "vue-router";
const axiosAuth= inject('axiosAuth') as AxiosInstance;
const { init } = useToast();
const router = useRouter();
let file: {
name: "Example",
@ -41,7 +43,9 @@ function onFileChanged() {
"name": "Новая тренировка",
})
.then((response: AxiosResponse) => {
init({ message: "Тренировка успешно загружена!", color: "success" });
router.push({ name: "workout_item", params: { id: response.data.id } });
})
.catch((error: any) => {
init({