[frontend] Fix unsubscribe error handling
This commit is contained in:
parent
b46c605623
commit
94693ba8cf
|
@ -29,9 +29,16 @@ export class EmailUnsubscribeComponent implements OnInit {
|
||||||
this.route.snapshot.queryParams.token,
|
this.route.snapshot.queryParams.token,
|
||||||
this.route.snapshot.params.id
|
this.route.snapshot.params.id
|
||||||
)
|
)
|
||||||
.subscribe(() => {
|
.subscribe(
|
||||||
|
() => {
|
||||||
this.status = 'You were successfully unsubscribed.';
|
this.status = 'You were successfully unsubscribed.';
|
||||||
});
|
},
|
||||||
|
(error) => {
|
||||||
|
if (error.status === 400) {
|
||||||
|
this.status = 'Invalid unsubscribe link.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['/404']);
|
this.router.navigate(['/404']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue