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 = {
"userId": this.user._id,
"oldRankLvl": this.user.rank.level,
"newRankLvl": this.newLevel,
"newRankLvl": this.newLevel
};
this.promotionService.requestPromotion(promotion).subscribe();
this.promotionService.requestPromotion(promotion).subscribe(() => {
this.showSuccessLabel = true;
setTimeout(() => {
this.showSuccessLabel = false;
}, 2000);
this.showForm = false;
this.user = {};
let currentUser = JSON.parse(localStorage.getItem('currentUser'));
this.promotionService.getSquadPromotions(currentUser.squad._id).subscribe(promotions => {
this.uncheckedPromotions = promotions;
})
});
}
cancel() {