feat(match): normalize player lists before updating match data
- Added a `normalizeList` function to filter out duplicates and invalid entries from player arrays. - Updated the match update logic to use normalized player lists for `playersReady`, `playersPlanned`, and `playersPlayed`. - Enhanced error handling in the ScheduleView to throw an error for failed match updates based on response status.
This commit is contained in:
@@ -502,6 +502,9 @@ export default {
|
||||
playersPlanned,
|
||||
playersPlayed
|
||||
});
|
||||
if (response.status >= 400) {
|
||||
throw new Error(response?.data?.error || 'Failed to update match players');
|
||||
}
|
||||
console.log('[savePlayerSelection] API response:', response);
|
||||
|
||||
// Update local match data
|
||||
|
||||
Reference in New Issue
Block a user