Move API_ORIGIN into constants.js

This commit is contained in:
Johannes Zellner
2025-03-03 11:22:56 +01:00
parent 6c674e86e5
commit ef0a9a4a1e
37 changed files with 196 additions and 217 deletions
+2 -4
View File
@@ -7,7 +7,7 @@ const t = i18n.t;
import { ref, watch, onMounted, useTemplateRef } from 'vue';
import { Icon, Button, Switch, Checkbox, FormGroup, TextInput, TableView, ButtonGroup, Dialog } from 'pankow';
import { prettyLongDate } from 'pankow/utils';
import { SECRET_PLACEHOLDER } from '../../constants.js';
import { API_ORIGIN, SECRET_PLACEHOLDER } from '../../constants.js';
import { download } from '../../utils.js';
import AppsModel from '../../models/AppsModel.js';
import BackupsModel from '../../models/BackupsModel.js';
@@ -88,9 +88,7 @@ async function onEditSubmit() {
function getDownloadLink(backup) {
const accessToken = localStorage.token;
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
return `${origin}/api/v1/apps/${props.app.id}/backups/${backup.id}/download?access_token=${accessToken}`;
return `${API_ORIGIN}/api/v1/apps/${props.app.id}/backups/${backup.id}/download?access_token=${accessToken}`;
}
async function onDownloadConfig(backup) {