Added save and remove requests.

This commit is contained in:
Keith Holliday
2019-10-17 09:23:26 -06:00
parent cad907125b
commit 5847f0b16e
5 changed files with 64 additions and 23 deletions

View File

@@ -1,18 +1,40 @@
<template>
<div @click='selectRequest()'>
{{request.name}}
<button class="add-button" @click="removeRequest">x</button>
</div>
</template>
<style scoped>
.add-button {
padding: 0;
width: 20px;
margin: 0;
height: 20px;
border-radius: 50%;
}
</style>
<script>
export default {
props: {
request: Object,
collectionIndex: Number,
folderIndex: Number,
requestIndex: Number,
},
methods: {
selectRequest() {
this.$store.commit('postwoman/selectRequest', { 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,
});
},
},
};
</script>