fixed backup bug + removed console.logs

This commit is contained in:
Hayden 2021-01-09 12:56:20 -09:00
parent b8f7b58da3
commit 1559b015af
8 changed files with 56 additions and 10 deletions

View file

@ -19,8 +19,9 @@ export default {
},
async import(fileName) {
apiReq.post(backupURLs.importBackup(fileName));
let response = await apiReq.post(backupURLs.importBackup(fileName));
store.dispatch("requestRecentRecipes");
return response;
},
async delete(fileName) {

View file

@ -12,7 +12,6 @@ export default {
async migrateChowdown(repoURL) {
let postBody = { url: repoURL };
let response = await apiReq.post(migrationURLs.chowdownURL, postBody);
console.log(response);
store.dispatch("requestRecentRecipes");
return response.data;
},

View file

@ -24,7 +24,7 @@
:items="availableTemplates"
v-model="selectedTemplate"
></v-combobox>
</v-col>
</v-col>0
<v-col dense cols="12" sm="12" md="2">
<v-btn block color="accent" @click="createBackup" width="165">
Backup Recipes
@ -56,16 +56,28 @@
</v-btn>
</v-col>
</v-row>
<SuccessFailureAlert
success-header="Successfully Imported"
:success="successfulImports"
failed-header="Failed Imports"
:failed="failedImports"
/>
</v-card-text>
</v-card>
</template>
<script>
import api from "../../../api";
import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
export default {
components: {
SuccessFailureAlert,
},
data() {
return {
failedImports: [],
successfulImports: [],
backupLoading: false,
backupTag: null,
selectedBackup: null,
@ -83,11 +95,15 @@ export default {
this.availableBackups = response.imports;
this.availableTemplates = response.templates;
},
importBackup() {
async importBackup() {
if (this.$refs.form.validate()) {
this.backupLoading = true;
api.backups.import(this.selectedBackup);
let response = await api.backups.import(this.selectedBackup);
console.log(response.data);
this.failedImports = response.data.failed;
this.successfulImports = response.data.successful;
this.backupLoading = false;
}
},

View file

@ -40,6 +40,7 @@
<script>
import api from "../../../api";
// import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
// import TimePicker from "./Webhooks/TimePicker";
export default {
data() {

View file

@ -150,7 +150,6 @@ export default {
this.availableThemes = await api.themes.requestAll();
this.selectedTheme = this.$store.getters.getActiveTheme;
this.selectedDarkMode = this.$store.getters.getDarkMode;
console.log(this.selectedDarkMode);
},
methods: {
@ -201,7 +200,6 @@ export default {
},
setStoresDarkMode() {
console.log(this.selectedDarkMode);
this.$store.commit("setDarkMode", this.selectedDarkMode);
},
/**

View file

@ -0,0 +1,34 @@
<template>
<div>
<v-alert v-if="success[0]" outlined dense type="success">
<h4>{{ successHeader }}</h4>
<v-list dense>
<v-list-item v-for="success in this.success" :key="success">
{{ success }}
</v-list-item>
</v-list>
</v-alert>
<v-alert v-if="failed[0]" outlined dense type="error">
<h4>{{ failedHeader }}</h4>
<v-list dense>
<v-list-item v-for="fail in this.failed" :key="fail">
{{ fail }}
</v-list-item>
</v-list>
</v-alert>
</div>
</template>
<script>
export default {
props: {
successHeader: String,
success: Array,
failedHeader: String,
failed: Array,
},
};
</script>
<style>
</style>

View file

@ -55,7 +55,6 @@ export default {
},
async mounted() {
this.mealPlan = await api.mealPlans.thisWeek();
console.log(this.mealPlan);
},
methods: {
getOrder(index) {

View file

@ -56,7 +56,6 @@ export default {
computed: {
newVersion() {
if ((this.latestVersion != null) & (this.latestVersion != this.version)) {
console.log("New Version Avaiable");
return true;
} else {
return false;
@ -68,7 +67,6 @@ export default {
let response = await axios.get(
"https://api.github.com/repos/hay-kot/mealie/releases/latest"
);
console.log(response);
this.latestVersion = response.data.tag_name;
},
},