some fixes for uploading workout
Gitea Actions Demo / build_and_push (push) Successful in 5m13s Details

This commit is contained in:
artem 2024-09-09 17:20:29 +03:00
parent 5767356d73
commit c0492b1977
2 changed files with 3 additions and 3 deletions

View File

@ -15,6 +15,7 @@ app.use(router);
app.use(i18n); app.use(i18n);
app.use(createVuestic({ config: vuesticGlobalConfig })); app.use(createVuestic({ config: vuesticGlobalConfig }));
app.provide('HOST', "https://cycle-rider.ru"); app.provide('HOST', "https://cycle-rider.ru");
//app.provide('HOST', "http://localhost:8000");
if (import.meta.env.VITE_APP_GTM_ENABLED) { if (import.meta.env.VITE_APP_GTM_ENABLED) {
app.use( app.use(
createGtm({ createGtm({

View File

@ -3,7 +3,7 @@
<h1 class="page-title">Загрузить тренировку</h1> <h1 class="page-title">Загрузить тренировку</h1>
<VaFileUpload <VaFileUpload
v-model="file" v-model="file"
file-types="image/*" file-types="gpx,fit"
type="single" type="single"
v-on:update:model-value="onFileChanged" v-on:update:model-value="onFileChanged"
color="#F4F6F8" color="#F4F6F8"
@ -39,7 +39,7 @@ function onFileChanged() {
} }
}).then(function (response) { }).then(function (response) {
axios axios
.patch(`${HOST}/api/v0/workouts`, { .post(`${HOST}/api/v0/workouts`, {
"attachment_id": response.data.id, "attachment_id": response.data.id,
"name": "Новая тренировка", "name": "Новая тренировка",
}, { }, {
@ -57,7 +57,6 @@ function onFileChanged() {
}); });
}) })
.catch(function (error) { .catch(function (error) {
console.log("2", error);
init({ init({
message: "Что-то пошло не так.", message: "Что-то пошло не так.",
color: "error", color: "error",