From c756be54a1ed7e15472078ac0fb8806706479e65 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Tue, 11 May 2021 13:10:36 +0000 Subject: [PATCH] refactor: separate request components for team & my collections --- components/collections/my/Collection.vue | 2 +- components/collections/my/Folder.vue | 2 +- components/collections/{ => my}/Request.vue | 39 ++---- components/collections/teams/Collection.vue | 2 +- components/collections/teams/Folder.vue | 2 +- components/collections/teams/Request.vue | 140 ++++++++++++++++++++ 6 files changed, 154 insertions(+), 33 deletions(-) rename components/collections/{ => my}/Request.vue (78%) create mode 100644 components/collections/teams/Request.vue diff --git a/components/collections/my/Collection.vue b/components/collections/my/Collection.vue index 1cfa96d4e..a85bbe819 100644 --- a/components/collections/my/Collection.vue +++ b/components/collections/my/Collection.vue @@ -98,7 +98,7 @@ :key="index" class="ml-8 border-l border-brdColor" > - - { - // Result - this.$toast.success(this.$t("deleted"), { - icon: "delete", - }) - }) - .catch((error) => { - // Error - this.$toast.error(this.$t("error_occurred"), { - icon: "done", - }) - console.error(error) - }) - this.$data.confirmRemove = false - } + this.$store.commit("postwoman/removeRequest", { + collectionIndex: this.$props.collectionIndex, + folderName: this.$props.folderName, + requestIndex: this.$props.requestIndex, + flag: "rest", + }) + this.$toast.error(this.$t("deleted"), { + icon: "delete", + }) + this.syncCollections() }, getRequestLabelColor(method) { return this.requestMethodLabels[method.toLowerCase()] || this.requestMethodLabels.default diff --git a/components/collections/teams/Collection.vue b/components/collections/teams/Collection.vue index 77250ef07..3954ed822 100644 --- a/components/collections/teams/Collection.vue +++ b/components/collections/teams/Collection.vue @@ -106,7 +106,7 @@ :key="index" class="ml-8 border-l border-brdColor" > - - +
+
+
+ +
+ + + + +
+ +
+ + +