Skip to content

Commit

Permalink
updating original records
Browse files Browse the repository at this point in the history
  • Loading branch information
noahsw committed Aug 7, 2016
1 parent 479d0bb commit 14d5260
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/imports/api/season_league_teams/season_league_teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,21 @@ Factory.define('seasonLeagueTeam', SeasonLeagueTeams, {
}).after(factory => {
const season = Seasons.findOne(factory.seasonId);
season.leagueId = factory.leagueId;
Seasons.update(season._id,
{
$set: {
leagueId: factory.leagueId,
},
});

const leagueTeam = LeagueTeams.findOne(factory.leagueTeamId);
leagueTeam.leagueId = factory.leagueId;

LeagueTeams.update(leagueTeam._id,
{
$set: {
leagueId: factory.leagueId,
},
});

log.debug('seasonLeagueTeam factory created:', factory);
});

0 comments on commit 14d5260

Please sign in to comment.