feat(club): refine access control in loadOpenRequests method
- Added a check for access permissions before loading open requests to enhance security and prevent unauthorized access. - Updated the mounted lifecycle hook to conditionally call loadOpenRequests based on access permissions, improving user experience and performance.
This commit is contained in:
@@ -135,6 +135,7 @@ export default {
|
||||
},
|
||||
async loadOpenRequests() {
|
||||
try {
|
||||
if (!this.accessAllowed) return;
|
||||
const clubId = this.getClubId();
|
||||
const response = await apiClient.get(`/clubmembers/notapproved/${clubId}`);
|
||||
this.openRequests = response.data;
|
||||
@@ -191,7 +192,9 @@ export default {
|
||||
},
|
||||
async mounted() {
|
||||
await this.loadClub();
|
||||
await this.loadOpenRequests();
|
||||
if (this.accessAllowed) {
|
||||
await this.loadOpenRequests();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user