Fix promotion request list update

pull/1/head
Florian Hartwich 2017-07-22 23:36:36 +02:00
parent dd31c355cf
commit bc24aaf26f
1 changed files with 13 additions and 14 deletions

View File

@ -61,22 +61,21 @@ export class RequestPromotionComponent {
const promotion = { const promotion = {
"userId": this.user._id, "userId": this.user._id,
"oldRankLvl": this.user.rank.level, "oldRankLvl": this.user.rank.level,
"newRankLvl": this.newLevel, "newRankLvl": this.newLevel
}; };
this.promotionService.requestPromotion(promotion).subscribe(); this.promotionService.requestPromotion(promotion).subscribe(() => {
this.showSuccessLabel = true; this.showSuccessLabel = true;
setTimeout(() => { setTimeout(() => {
this.showSuccessLabel = false; this.showSuccessLabel = false;
}, 2000); }, 2000);
this.showForm = false; this.showForm = false;
this.user = {}; this.user = {};
let currentUser = JSON.parse(localStorage.getItem('currentUser'));
let currentUser = JSON.parse(localStorage.getItem('currentUser')); this.promotionService.getSquadPromotions(currentUser.squad._id).subscribe(promotions => {
this.promotionService.getSquadPromotions(currentUser.squad._id).subscribe(promotions => { this.uncheckedPromotions = promotions;
this.uncheckedPromotions = promotions; })
}) });
} }
cancel() { cancel() {