Skip to content

Commit

Permalink
Display correct team name on old profiles
Browse files Browse the repository at this point in the history
This fixes the issue that on an old profile the name of a users
current team would be displayed on top of the cards instead of the
correct one.

This does not fix the issue for the card that creates a new posting,
see #353
  • Loading branch information
florianschmidt1994 committed May 11, 2019
1 parent 9064dc3 commit 964d6bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/server/controller/TeamController.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ TeamController.getTeamByUrl = (teamId, token) => co(function* () {
let postings = responses[4];
let locations = responses[5];

tempTeam.postings = postings;
tempTeam.postings = postings.map(p => {
p.teamId = tempTeam.id;
p.teamName = tempTeam.name;
return p;
});

tempTeam.event = events
.filter((event) => event.id === tempTeam.event)
Expand Down
2 changes: 1 addition & 1 deletion src/server/views/partials/team-posting.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>
<div class="col-xs-9">
<div class="bo-card-info-name">
<span class="bo-card-info-headline"><a href="/team/{{user.participant.teamId}}" class="no-underline">{{user.participant.teamName}}</a> </span>
<span class="bo-card-info-headline"><a href="/team/{{teamId}}" class="no-underline">{{teamName}}</a> </span>
<a href="/post/{{id}}" class="bo-card-info-sub no-underline">{{user.firstname}} {{relativeTime date}}{{prettyLocation postingLocation.locationData}}</a>
</div>
</div>
Expand Down

0 comments on commit 964d6bf

Please sign in to comment.