Skip to content

Commit

Permalink
fix delete member bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Leeeef552 committed Apr 25, 2024
1 parent 041c6cc commit beb9f32
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/components/EditGroupInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
class="member-item"
>
{{ member.name }}
<button @click="showWarning(member.id)" class="kick-btn">
<button @click="showWarningKick(member.id)" class="kick-btn">
Kick Out
</button>
</li>
Expand All @@ -68,11 +68,11 @@

<!--Warning Message for Delete Member-->
<WarningMessage
v-if="showWarningMessage"
v-if="showWarningMessageKick"
:condition="condition"
:memberid="selectedMemberId"
@confirm="removeMemberFromGroup"
@cancel="hideWarning"
@cancel="hideWarningKick"
/>

<!--Warning Message for Delete Group-->
Expand Down Expand Up @@ -134,6 +134,7 @@ export default {
imageUrl: "",
selectedFile: null,
showWarningMessage: false,
showWarningMessageKick: false,
selectedMemberId: "",
condition: "",
};
Expand Down Expand Up @@ -202,7 +203,7 @@ export default {
// remove the group from user doc as well
await this.removeGroupFromUser(memberID);
this.showWarningMessage = false;
this.showWarningMessageKick = false;
this.selectedMemberId = "";
} catch (error) {
console.log("Error in kicking member out", error);
Expand Down Expand Up @@ -314,18 +315,23 @@ export default {
this.$router.push({ name: "MyGroups" });
},
showWarning(memberId = null) {
if (memberId instanceof Event) {
this.condition = "deleteGroup";
} else {
this.selectedMemberId = memberId;
this.condition = "deleteMemberFromGroup";
}
showWarning() {
this.condition = "deleteGroup";
this.showWarningMessage = true;
},
hideWarning() {
this.showWarningMessage = false;
},
showWarningKick(memberId) {
this.selectedMemberId = memberId;
this.condition = "deleteMemberFromGroup";
this.showWarningMessageKick = true;
},
hideWarningKick() {
this.showWarningMessageKick = false;
},
},
created() {
this.fetchGroupData();
Expand Down

0 comments on commit beb9f32

Please sign in to comment.