mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
⚡ display error message on creation if any
This commit is contained in:
parent
0c24b2e602
commit
83e00d57f8
@ -1,6 +1,7 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { PollService } from '../../../core/services/poll.service';
|
import { PollService } from '../../../core/services/poll.service';
|
||||||
|
import { ToastService } from 'src/app/core/services/toast.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-nav-steps',
|
selector: 'app-nav-steps',
|
||||||
@ -26,7 +27,7 @@ export class NavStepsComponent implements OnInit {
|
|||||||
@Input()
|
@Input()
|
||||||
next_is_disabled: any = false;
|
next_is_disabled: any = false;
|
||||||
|
|
||||||
constructor(private router: Router, public pollService: PollService) {}
|
constructor(private router: Router, private toastService: ToastService, public pollService: PollService) {}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
|
|
||||||
@ -45,11 +46,13 @@ export class NavStepsComponent implements OnInit {
|
|||||||
createPoll() {
|
createPoll() {
|
||||||
this.pollService.createPoll().then(
|
this.pollService.createPoll().then(
|
||||||
(resp) => {
|
(resp) => {
|
||||||
this.router.navigate(['/administration/success']);
|
console.log('resp', resp);
|
||||||
|
this.router.navigate(['/administration/success/']);
|
||||||
this.pollService.step_current = null;
|
this.pollService.step_current = null;
|
||||||
},
|
},
|
||||||
(err) => {
|
(err: any) => {
|
||||||
console.error('oops err', err);
|
console.error('oops err', err);
|
||||||
|
this.toastService.display(err.message);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user