Add SentComponent for form submission confirmation and integrate with email verification flow

This commit is contained in:
2025-08-23 22:42:18 +02:00
parent 523bf3d43f
commit d1da1296bb
6 changed files with 85 additions and 3 deletions
@@ -23,6 +23,7 @@ import {MatInputModule} from '@angular/material/input';
import {HistoryFormatService} from '@pages/reference/bans/history-format.service';
import {MatDialog} from '@angular/material/dialog';
import {VerifyMailDialogComponent} from '@pages/forms/verify-mail-dialog/verify-mail-dialog.component';
import {Router} from '@angular/router';
@Component({
selector: 'app-appeal',
@@ -163,6 +164,8 @@ export class AppealComponent implements OnInit, OnDestroy, AfterViewInit {
}
}
private router = inject(Router)
private sendForm() {
const rawValue = this.form.getRawValue();
const uuid = this.authService.getUuid();
@@ -177,7 +180,14 @@ export class AppealComponent implements OnInit, OnDestroy, AfterViewInit {
username: this.authService.username()!,
uuid: uuid
}
this.appealsService.submitMinecraftAppeal(appeal).subscribe()
this.appealsService.submitMinecraftAppeal(appeal).subscribe((result) => {
if (!result.verified_mail) {
throw new Error('Mail not verified');
}
this.router.navigate(['/form/sent'], {
state: {message: result.message}
}).then();
})
}
public currentPageIndex: number = 0;