mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 05:28:13 +00:00
axios: baseURL
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
|
||||
<div class="pane">
|
||||
Pokazuj maks.
|
||||
<input type="number" min="1" v-model="store.maxVisibleResults" style="width: 50px; margin: 0 0.5em;" />
|
||||
<input type="number" min="1" v-model="store.maxVisibleResults" style="width: 50px; margin: 0 0.5em" />
|
||||
wyników
|
||||
</div>
|
||||
|
||||
@@ -76,7 +76,6 @@
|
||||
<script lang="ts">
|
||||
import axios from 'axios';
|
||||
import { defineComponent } from 'vue';
|
||||
import dataMixin from '../mixins/dataMixin';
|
||||
import routesMixin from '../mixins/routesMixin';
|
||||
import { useStore } from '../store';
|
||||
import { AuthState, Availability, ChangeProp, HeaderTypes, SceneryRowItem } from '../types/types';
|
||||
@@ -95,7 +94,7 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
|
||||
mixins: [dataMixin, routesMixin],
|
||||
mixins: [routesMixin],
|
||||
|
||||
computed: {
|
||||
changelog() {
|
||||
@@ -133,7 +132,7 @@ export default defineComponent({
|
||||
confirmLoadData() {
|
||||
const confirmed = confirm('Czy na pewno chcesz odświeżyć dane? Wszelkie niezapisane zmiany zostaną utracone!');
|
||||
|
||||
if (confirmed) this.loadData();
|
||||
if (confirmed) this.store.fetchSceneriesData();
|
||||
},
|
||||
|
||||
confirmRestoreList() {
|
||||
@@ -174,24 +173,10 @@ export default defineComponent({
|
||||
return { ...v };
|
||||
});
|
||||
|
||||
const response = await axios.post(
|
||||
`${this.API_URL}/manager/updateSceneryList`,
|
||||
{
|
||||
changeList: mappedChangeList,
|
||||
token: this.store.token,
|
||||
notify: this.store.notifyDiscord,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${this.store.token}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
const updateResData = (await this.store.updateSceneriesData(mappedChangeList)).data
|
||||
this.store.changesResponse = updateResData;
|
||||
|
||||
this.store.changesResponse = response.data;
|
||||
|
||||
this.loadData();
|
||||
this.store.fetchSceneriesData();
|
||||
} catch (error) {
|
||||
this.store.alertMessage = 'Ups! Wystąpił błąd podczas zapisywania danych!';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user