You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
962 B
TypeScript
32 lines
962 B
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
import { takeUntil } from 'rxjs/operators';
|
|
import { BaseComponent } from '../../../core/common/base/base.component';
|
|
import { InvitationService } from '../../../services/invitation/invitation.service';
|
|
|
|
@Component({
|
|
selector: 'app-invitation-accepted-component',
|
|
templateUrl: 'invitation-accepted.component.html',
|
|
|
|
})
|
|
export class InvitationAcceptedComponent extends BaseComponent implements OnInit {
|
|
constructor(
|
|
private invitationService: InvitationService,
|
|
private route: ActivatedRoute,
|
|
public router: Router
|
|
) { super(); }
|
|
|
|
ngOnInit(): void {
|
|
this.route.params
|
|
.pipe(takeUntil(this._destroyed))
|
|
.subscribe(params => {
|
|
const id = params['id'];
|
|
this.invitationService.exchange(id)
|
|
.pipe(takeUntil(this._destroyed))
|
|
.subscribe(result => {
|
|
this.router.navigate(['dmps/edit/' + result]);
|
|
});
|
|
});
|
|
}
|
|
}
|