]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/helpers/Tournament.js
sort results by time
[alttp.git] / resources / js / helpers / Tournament.js
index 5716e684948b53c84e54262f00d99b553943d755..6b4ca28fb93c2c185ec096ed4579707a93f52ead 100644 (file)
@@ -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;