Components/create-modal: update form

This commit is contained in:
Toast 2025-01-30 11:50:31 +01:00
parent 4f505507be
commit ac9d6a4566
2 changed files with 8 additions and 3 deletions

View file

@ -9,13 +9,17 @@
<input formControlName="title" type="text" class="form-control"/> <input formControlName="title" type="text" class="form-control"/>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Year</label> <label class="form-label">Date</label>
<input formControlName="year" type="number" class="form-control"/> <input formControlName="date" type="date" class="form-control"/>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Seasons</label> <label class="form-label">Seasons</label>
<input formControlName="seasons" type="number" class="form-control"/> <input formControlName="seasons" type="number" class="form-control"/>
</div> </div>
<div class="mb-3">
<label class="form-label">Episodes</label>
<input formControlName="episodes" type="number" class="form-control"/>
</div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Description</label> <label class="form-label">Description</label>
<input formControlName="description" type="text" class="form-control"/> <input formControlName="description" type="text" class="form-control"/>

View file

@ -17,8 +17,9 @@ export class CreateModalComponent {
constructor() { constructor() {
this.newShowForm = new FormGroup({ this.newShowForm = new FormGroup({
title: new FormControl("", Validators.required), title: new FormControl("", Validators.required),
year: new FormControl("", [Validators.required, Validators.min(1900)]), date: new FormControl("", Validators.required),
seasons: new FormControl("", [Validators.required, Validators.min(1)]), seasons: new FormControl("", [Validators.required, Validators.min(1)]),
episodes: new FormControl("", [Validators.required, Validators.min(1)]),
description: new FormControl("", Validators.required) description: new FormControl("", Validators.required)
}) })
} }