X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2FTournament.js;h=6b4ca28fb93c2c185ec096ed4579707a93f52ead;hb=14bee4bbb112ddab53914fa777be6004debeb5c4;hp=5716e684948b53c84e54262f00d99b553943d755;hpb=ccaa2cf99468fea81efdf28aaa3fc72a278a95f6;p=alttp.git diff --git a/resources/js/helpers/Tournament.js b/resources/js/helpers/Tournament.js index 5716e68..6b4ca28 100644 --- a/resources/js/helpers/Tournament.js +++ b/resources/js/helpers/Tournament.js @@ -19,6 +19,14 @@ export const patchResult = (tournament, result) => { }; }; +export const patchRound = (tournament, round) => { + if (!tournament) return tournament; + return { + ...tournament, + rounds: tournament.rounds.map(r => r.id === round.id ? round : r), + }; +}; + export const sortParticipants = tournament => { if (!tournament || !tournament.participants || !tournament.participants.length) { return tournament;