diff --git a/backend/controllers/falukantController.js b/backend/controllers/falukantController.js index ea722c2..ca0bfc6 100644 --- a/backend/controllers/falukantController.js +++ b/backend/controllers/falukantController.js @@ -69,7 +69,10 @@ class FalukantController { this.getStockOverview = this._wrapSimple(() => this.service.getStockOverview()); this.getAllProductions = this._wrapWithUser((userId) => this.service.getAllProductions(userId)); - this.getDirectorProposals = this._wrapWithUser((userId, req) => this.service.getDirectorProposals(userId, req.body.branchId)); + this.getDirectorProposals = this._wrapWithUser((userId, req) => { + console.log('🔍 getDirectorProposals called with userId:', userId, 'branchId:', req.body.branchId); + return this.service.getDirectorProposals(userId, req.body.branchId); + }); this.convertProposalToDirector = this._wrapWithUser((userId, req) => this.service.convertProposalToDirector(userId, req.body.proposalId)); this.getDirectorForBranch = this._wrapWithUser((userId, req) => this.service.getDirectorForBranch(userId, req.params.branchId)); this.getAllDirectors = this._wrapWithUser((userId) => this.service.getAllDirectors(userId)); @@ -89,7 +92,10 @@ class FalukantController { return result; }); this.acceptMarriageProposal = this._wrapWithUser((userId, req) => this.service.acceptMarriageProposal(userId, req.body.proposalId)); - this.getGifts = this._wrapWithUser((userId) => this.service.getGifts(userId)); + this.getGifts = this._wrapWithUser((userId) => { + console.log('🔍 getGifts called with userId:', userId); + return this.service.getGifts(userId); + }); this.getChildren = this._wrapWithUser((userId) => this.service.getChildren(userId)); this.sendGift = this._wrapWithUser((userId, req) => this.service.sendGift(userId, req.body.giftId)); diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index 4851429..bd15530 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -134,6 +134,7 @@ class FalukantService extends BaseService { `; async getFalukantUserByHashedId(hashedId) { + console.log('🔍 getFalukantUserByHashedId called with hashedId:', hashedId); const user = await FalukantUser.findOne({ include: [ { model: User, as: 'user', attributes: ['username', 'hashedId'], where: { hashedId } }, @@ -162,6 +163,7 @@ class FalukantService extends BaseService { }, ] }); + console.log('🔍 getFalukantUserByHashedId result:', user ? 'User found' : 'User not found'); if (!user) throw new Error('User not found'); return user; } diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index c51e013..2525b85 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -132,13 +132,14 @@ const store = createStore({ console.log('🔌 Initializing Daemon WebSocket connection to:', daemonUrl); console.log('🔌 Protocol:', 'yourpart-protocol'); try { - // Versuche zuerst mit Protokoll, dann ohne + // Versuche zuerst ohne Protokoll, da der Server es möglicherweise nicht unterstützt let daemonSocket; try { - daemonSocket = new WebSocket(daemonUrl, 'yourpart-protocol'); - } catch (protocolError) { - console.warn('⚠️ Protocol error, trying without protocol:', protocolError); + console.log('🔌 Trying WebSocket connection without protocol...'); daemonSocket = new WebSocket(daemonUrl); + } catch (error) { + console.error('❌ Failed to create WebSocket:', error); + throw error; } daemonSocket.onopen = () => {