migration

This commit is contained in:
_Bastler
2022-01-21 22:38:31 +01:00
parent 5cf6230005
commit 578e6e6981
36 changed files with 1473 additions and 1012 deletions
+20 -17
View File
@@ -44,24 +44,27 @@ export class InviteEditComponent {
this.invite.message = this.form.get("message").value;
this.invite.note = this.form.get("note").value;
this.inviteService.update(this.invite).subscribe((result: any) => {
this.working = false;
this.dialogRef.close(result);
}, (error) => {
this.working = false;
if (error.status == 406) {
this.error = "INVALID_CODE";
} if (error.status == 410) {
this.error = "ALREADY_REDEEMED";
} else if (error.status == 409) {
let errors = {};
for (let code of error.error) {
errors[ code.field ] = errors[ code.field ] || {};
errors[ code.field ][ code.code ] = true;
}
this.inviteService.update(this.invite).subscribe({
next: (result: any) => {
this.working = false;
this.dialogRef.close(result);
},
error: (error) => {
this.working = false;
if (error.status == 406) {
this.error = "INVALID_CODE";
} if (error.status == 410) {
this.error = "ALREADY_REDEEMED";
} else if (error.status == 409) {
let errors = {};
for (let code of error.error) {
errors[ code.field ] = errors[ code.field ] || {};
errors[ code.field ][ code.code ] = true;
}
for (let code in errors) {
this.form.get(code).setErrors(errors[ code ]);
for (let code in errors) {
this.form.get(code).setErrors(errors[ code ]);
}
}
}
})