check validity and display send toast

This commit is contained in:
Tykayn 2021-05-18 16:13:03 +02:00 committed by tykayn
parent 03cbb508c7
commit 09a507109a
2 changed files with 3 additions and 2 deletions

View File

@ -18,8 +18,8 @@
{{ 'creation.want' | translate }} {{ 'creation.want' | translate }}
</p> </p>
<!-- <div class="step-choices" *ngIf="currentStep === 'base'">--> <!-- <div class="step-choices" *ngIf="currentStep === 'base'">-->
<!-- <app-kind-select [form]="form"></app-kind-select>--> <app-kind-select [form]="form"></app-kind-select>
<!-- <app-base-config [form]="form"></app-base-config>--> <app-base-config [form]="form"></app-base-config>
<!-- </div>--> <!-- </div>-->
<!-- <div class="step-choices" *ngIf="currentStep === 'choices'"> </div>--> <!-- <div class="step-choices" *ngIf="currentStep === 'choices'"> </div>-->
<app-date-select *ngIf="form.value && form.value.kind == 'date'" [form]="form"></app-date-select> <app-date-select *ngIf="form.value && form.value.kind == 'date'" [form]="form"></app-date-select>

View File

@ -180,6 +180,7 @@ export class FormComponent implements OnInit {
); );
} else { } else {
if (this.form.valid) { if (this.form.valid) {
this.toastService.display("C'est parti!");
this.apiService.createPoll(newpoll).then( this.apiService.createPoll(newpoll).then(
(resp: any) => { (resp: any) => {
this.pollService.updateCurrentPoll(resp.data.poll); this.pollService.updateCurrentPoll(resp.data.poll);