1 export const patchResult = (round, result) => {
2 if (!round) return round;
3 if (!round.results || !round.results.length) {
4 return { ...round, results: [result] };
6 if (!round.results.find(r => r.id === result.id)) {
7 return { ...round, results: [...round.results, result] };
11 results: round.results.map(r => r.id === result.id ? result : r),