Fügt die Funktionalität zur Aktualisierung der Vereinseinstellungen hinzu. Implementiert die Methode updateClubSettings im clubsController, um Begrüßungstexte und Mitgliedsnummern zu aktualisieren. Aktualisiert das Club-Modell, um neue Felder für greetingText und associationMemberNumber zu unterstützen. Ergänzt die Routen in clubRoutes, um die neuen Einstellungen zu verarbeiten. Fügt eine neue Ansicht für die Vereins-Einstellungen im Frontend hinzu und aktualisiert die Navigation entsprechend.

This commit is contained in:
Torsten Schulz (local)
2025-10-03 19:49:19 +02:00
parent 4b1a046149
commit ac727c6c5b
12 changed files with 1144 additions and 48 deletions

View File

@@ -55,6 +55,15 @@ class ClubService {
});
}
async updateClubSettings(userToken, clubId, { greetingText, associationMemberNumber }) {
await checkAccess(userToken, clubId);
const club = await Club.findByPk(clubId);
if (!club) {
throw new Error('clubnotfound');
}
return await club.update({ greetingText, associationMemberNumber });
}
async approveUserClubAccess(userToken, clubId, toApproveUserId) {
await checkAccess(userToken, clubId);
const toApproveUserClub = await UserClub.findOne({

View File

@@ -8,7 +8,6 @@ class NuscoreProxyService {
async initialize() {
if (!this.browser) {
console.log('🚀 Initialisiere Playwright Browser...');
this.browser = await chromium.launch({
headless: true,
args: [
@@ -26,7 +25,6 @@ class NuscoreProxyService {
ignoreHTTPSErrors: true
});
console.log('✅ Playwright Browser initialisiert');
}
}
@@ -34,7 +32,6 @@ class NuscoreProxyService {
try {
await this.initialize();
console.log(`🔍 Lade nuscore-Seite für Code: ${code}`);
const page = await this.context.newPage();
@@ -45,17 +42,14 @@ class NuscoreProxyService {
timeout: 30000
});
console.log('📄 Seite geladen');
// Optional: PIN automatisch einfügen falls vorhanden
if (pin) {
console.log(`🔑 Versuche PIN ${pin} einzufügen...`);
try {
// Suche nach PIN-Eingabefeld
const pinInput = await page.locator('input[type="password"][placeholder*="PIN"], input[placeholder*="Pin"], input[placeholder*="pin"]').first();
if (await pinInput.isVisible()) {
await pinInput.fill(pin);
console.log('✅ PIN eingefügt');
// Optional: Submit-Button klicken falls vorhanden
const submitBtn = await page.locator('button[type="submit"], input[type="submit"], button:has-text("Einloggen"), button:has-text("Anmelden")').first();
@@ -65,7 +59,6 @@ class NuscoreProxyService {
}
}
} catch (error) {
console.log('⚠️ PIN-Einfügung fehlgeschlagen:', error.message);
}
}
@@ -77,7 +70,6 @@ class NuscoreProxyService {
await page.close();
console.log('✅ nuscore-Seite erfolgreich proxiert');
return modifiedHtml;
} catch (error) {
@@ -138,7 +130,6 @@ class NuscoreProxyService {
await this.browser.close();
this.browser = null;
}
console.log('🧹 Playwright Browser bereinigt');
}
}