Add duplicated user error on create

pull/10/head
Florian Hartwich 2017-09-15 21:02:43 +02:00
parent 17b31df9a6
commit 5a7f002bdd
3 changed files with 24 additions and 7 deletions

View File

@ -39,7 +39,6 @@ const createAllSignatures = () => {
+ ': finished successful - UPDATE SIGNATURES');
})
});
};
const createBackup = () => {
@ -55,11 +54,10 @@ const createBackup = () => {
})
};
// Execute daily @ 02:30 AM
const cronJobSignature = cron.job('00 30 02 * * *', createAllSignatures);
// Execute every on Mon, Thu and Sat @ 04:00 AM
// Execute on Mon, Thu and Sat @ 04:00 AM
const cronJobBackup = cron.job('00 00 04 * * mon,thu,sat', createBackup);
module.exports = {

View File

@ -57,6 +57,11 @@
Bestätigen
</button>
<span *ngIf="showErrorLabel"
class="center-block label label-danger" style="font-size: medium; padding: 2px; margin-top: 2px">
{{error}}
</span>
<span *ngIf="showSuccessLabel"
class="label label-success label-small"
style="margin-left: inherit">

View File

@ -28,6 +28,10 @@ export class EditUserComponent {
ranksDisplay = 'none';
showErrorLabel = false;
error: string;
constructor(private router: Router,
private route: ActivatedRoute,
private userService: UserService,
@ -100,6 +104,16 @@ export class EditUserComponent {
.subscribe(user => {
this.router.navigate(['..'], {relativeTo: this.route});
return true;
},
error => {
// duplicated user error message
if (error._body.indexOf('duplicate') >= 0) {
this.error = "Benutzername existiert bereits";
this.showErrorLabel = true;
setTimeout(() => {
this.showErrorLabel = false;
}, 5000);
}
})
}
}