refactor, fix: split 'components/collections/saveRequest.vue' to 'editRequest', 'saveRequestAs'; fix saving bugs

This commit is contained in:
vlad0337187
2019-10-24 13:46:18 +03:00
parent 3743ff96ff
commit bd64e4a45b
9 changed files with 430 additions and 204 deletions

View File

@@ -7,10 +7,10 @@
</button>
</div>
<div>
<button class="icon" @click="removeRequest" v-tooltip="'Delete collection'">
<button class="icon" @click="removeRequest" v-tooltip="'Delete request'">
<i class="material-icons">delete</i>
</button>
<button class="icon" @click="editRequest" v-tooltip="'Edit request'">
<button class="icon" @click="$emit('edit-request')" v-tooltip="'Edit request'">
<i class="material-icons">edit</i>
</button>
</div>
@@ -33,25 +33,21 @@
<script>
export default {
props: {
request: Object,
collectionIndex: Number,
folderIndex: Number,
requestIndex: Number,
request : Object,
collectionIndex : Number,
folderIndex : Number,
requestIndex : Number,
},
methods: {
selectRequest() {
this.$store.commit('postwoman/selectRequest', { request: this.request });
},
editRequest() {
this.request.requestIndex = this.requestIndex;
this.$store.commit('postwoman/editRequest', { request: this.request });
},
removeRequest() {
if (!confirm("Are you sure you want to remove this request?")) return;
this.$store.commit('postwoman/removeRequest', {
collectionIndex: this.collectionIndex,
folderIndex: this.folderIndex,
requestIndex: this.requestIndex,
collectionIndex : this.collectionIndex,
folderIndex : this.folderIndex,
requestIndex : this.requestIndex,
});
},
},