Bilder hinzugefügt

This commit is contained in:
Torsten Schulz
2024-09-11 17:57:56 +02:00
parent 543a2f9259
commit 3b1021f7c8
7 changed files with 250 additions and 56 deletions

View File

@@ -1,9 +1,15 @@
import { getClubMembers, getWaitingApprovals, setClubMembers } from '../controllers/memberController.js';
import { getClubMembers, getWaitingApprovals, setClubMembers, uploadMemberImage, getMemberImage } from '../controllers/memberController.js';
import express from 'express';
import { authenticate } from '../middleware/authMiddleware.js';
import multer from 'multer';
const router = express.Router();
const storage = multer.memoryStorage();
const upload = multer({ storage: storage });
router.post('/:clubId/image/:memberId', authenticate, upload.single('image'), uploadMemberImage);
router.get('/:clubId/image/:memberId', authenticate, getMemberImage);
router.get('/:id', authenticate, getClubMembers);
router.post('/:id', authenticate, setClubMembers);
router.get('/notapproved/:id', authenticate, getWaitingApprovals);