more control
This commit is contained in:
@@ -7,7 +7,7 @@ const getClubMembers = async(req, res) => {
|
||||
|
||||
const getWaitingApprovals = async(req, res) => {
|
||||
try {
|
||||
const { clubid: clubId } = req.body;
|
||||
const { clubid: clubId } = req.params;
|
||||
const { hashedId: userToken} = req.headers;
|
||||
const waitingApprovals = MemberService.getApprovalRequests(userToken, clubId);
|
||||
res.status(200).json(waitingApprovals);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { getClubMembers } from '../controllers/memberController';
|
||||
import { getClubMembers, getWaitingApprovals } from '../controllers/memberController';
|
||||
import express from 'express';
|
||||
import { authenticate } from '../middleware/authMiddleware';
|
||||
|
||||
const router = express.Router;
|
||||
|
||||
router.post('/', authenticate, getClubMembers);
|
||||
router.get('/notapproved/:id', authenticate, getWaitingApprovals);
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -20,7 +20,7 @@ export default {
|
||||
name: 'App',
|
||||
data() {
|
||||
return {
|
||||
selectedClub: null, // Initialisiere selectedClub als null
|
||||
selectedClub: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -28,11 +28,9 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
selectedClub(newVal) {
|
||||
console.log('selectedClub watcher:', newVal);
|
||||
this.setCurrentClub(newVal);
|
||||
},
|
||||
currentClub(newVal) {
|
||||
console.log('currentClub watcher:', newVal);
|
||||
if (newVal === 'new') {
|
||||
this.$router.push('/createclub');
|
||||
} else if (newVal) {
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
<template>
|
||||
<h2>Verein {{ club.name }}</h2>
|
||||
<div v-if="openRequests.length > 0">
|
||||
<h3>Offene Anfragen auf Zugriff</h3>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Mitglieder</h3>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Traingstagebuch</h3>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapActions } from 'vuex';
|
||||
import apiClient from '../apiClient';
|
||||
|
||||
export default {
|
||||
name: "ClubView",
|
||||
data() {
|
||||
@@ -10,7 +22,14 @@ export default {
|
||||
club: {
|
||||
name: '',
|
||||
},
|
||||
openRequests: []
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async loadOpenRequests() {
|
||||
const notApproved = apiClient.get('/clubmembers/notapproved/' + id);
|
||||
this.openRequests = notApproved.data;
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user