US01, US03: Fix bug where all whitespaces were considered valid input on horse create and update

This commit is contained in:
2020-04-05 18:30:31 +02:00
parent a01405e3cc
commit 8e3736848d
4 changed files with 8 additions and 8 deletions

View File

@@ -17,12 +17,12 @@
<form (ngSubmit)="addHorse()" #horseForm="ngForm">
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" name="name" [(ngModel)]="horse.name" required>
<input type="text" class="form-control" name="name" pattern="\S+.*" [(ngModel)]="horse.name" required>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control" name="description" [(ngModel)]="horse.description" value=""></textarea>
<textarea class="form-control" name="description" pattern="\S+.*" [(ngModel)]="horse.description" value=""></textarea>
</div>
<div class="form-group">

View File

@@ -17,12 +17,12 @@
<form (ngSubmit)="updateHorse()" #horseForm="ngForm">
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" name="name" [(ngModel)]="horse.name" required>
<input type="text" class="form-control" name="name" [(ngModel)]="horse.name" pattern="\S+.*" required>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control" name="description" [(ngModel)]="horse.description"></textarea>
<textarea class="form-control" name="description" pattern="\S+.*" [(ngModel)]="horse.description"></textarea>
</div>
<div class="form-group">