feat(socket): implement match report submission and schedule update events
- Added WebSocket events for match report submission and schedule updates, enhancing real-time communication between clients and the server. - Updated matchController to emit schedule updates when match players are modified. - Enhanced nuscoreApiRoutes to emit match report submissions with relevant data for other clients. - Implemented socket service methods for handling incoming match report submissions and schedule updates in the frontend. - Updated MatchReportApiDialog and ScheduleView components to handle new WebSocket events, ensuring data synchronization across clients.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import MatchService from '../services/matchService.js';
|
||||
import fs from 'fs';
|
||||
|
||||
import { emitScheduleMatchUpdated } from '../services/socketService.js';
|
||||
import { devLog } from '../utils/logger.js';
|
||||
export const uploadCSV = async (req, res) => {
|
||||
try {
|
||||
@@ -116,7 +116,11 @@ export const updateMatchPlayers = async (req, res) => {
|
||||
playersPlanned,
|
||||
playersPlayed
|
||||
);
|
||||
|
||||
|
||||
if (result.clubId) {
|
||||
emitScheduleMatchUpdated(result.clubId, result.id, result.match || null);
|
||||
}
|
||||
|
||||
return res.status(200).json({
|
||||
message: 'Match players updated successfully',
|
||||
data: result
|
||||
|
||||
Reference in New Issue
Block a user