File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4242
4343 IF NEW .status = ' Finished' THEN
4444 NEW .ended_at = NOW();
45-
46- NEW .winning_lineup_id = get_match_map_winning_lineup_id(NEW);
4745 END IF;
4846
4947 RETURN NEW;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { e_match_map_status_enum } from "../../../generated";
33
44export default class MatchMapStatusEvent extends MatchEventProcessor < {
55 status : e_match_map_status_enum ;
6+ winning_lineup_id ?: string ;
67} > {
78 public async process ( ) {
89 const { matches_by_pk : match } = await this . hasura . query ( {
@@ -18,6 +19,8 @@ export default class MatchMapStatusEvent extends MatchEventProcessor<{
1819 return ;
1920 }
2021
22+ const isFinished = this . data . status === "Finished" ;
23+
2124 const { update_match_maps_by_pk } = await this . hasura . mutation ( {
2225 update_match_maps_by_pk : {
2326 __args : {
@@ -26,6 +29,9 @@ export default class MatchMapStatusEvent extends MatchEventProcessor<{
2629 } ,
2730 _set : {
2831 status : this . data . status ,
32+ ...( isFinished
33+ ? { winning_lineup_id : this . data . winning_lineup_id }
34+ : { } ) ,
2935 } ,
3036 } ,
3137 id : true ,
@@ -35,7 +41,7 @@ export default class MatchMapStatusEvent extends MatchEventProcessor<{
3541 } ,
3642 } ) ;
3743
38- if ( this . data . status === "Finished" ) {
44+ if ( isFinished ) {
3945 if ( update_match_maps_by_pk . match . current_match_map_id !== null ) {
4046 await this . matchAssistant . sendServerMatchId ( this . matchId ) ;
4147 return ;
You can’t perform that action at this time.
0 commit comments