Fixed an error where the book wasnt inserted when price or qty had a wrong value

This commit is contained in:
konrad 2017-11-21 11:02:23 +01:00 committed by kolaente
parent d33dcdf05d
commit 1b428e557f
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@
{{ success }} {{ success }}
</div> </div>
<form class="ui form" v-bind:class="{ loading: loading }" v-if="!success"> <form class="ui form" v-bind:class="{ loading: loading }" v-if="!success" @submit.prevent="insertNewBook">
<div class="field"> <div class="field">
<label>Title</label> <label>Title</label>
<input name="title" placeholder="Title" type="text" v-model="book.Title" required> <input name="title" placeholder="Title" type="text" v-model="book.Title" required>
@ -36,11 +36,11 @@
</div> </div>
<div class="field"> <div class="field">
<label>Year</label> <label>Year</label>
<input name="year" placeholder="Year" type="number" min="1800" v-model.number="book.Year"> <input name="year" placeholder="Year" type="number" step="1" min="1800" v-model.number="book.Year">
</div> </div>
<div class="field"> <div class="field">
<label>Quantity</label> <label>Quantity</label>
<input placeholder="Quantity" type="number" min="0" v-model.number="book.Quantity"> <input placeholder="Quantity" type="number" min="0" step="1" v-model.number="book.Quantity">
</div> </div>
</div> </div>
@ -100,7 +100,7 @@
</div> </div>
</div> </div>
<a class="ui blue button" type="submit" @click="insertNewBook()">Submit</a> <button class="ui blue button" type="submit">Submit</button>
</form> </form>
</div> </div>
</template> </template>
@ -121,7 +121,7 @@
Title: '', Title: '',
Isbn: '', Isbn: '',
Year: (new Date()).getFullYear(), Year: (new Date()).getFullYear(),
Price: null, Price: 0,
Status: 0, Status: 0,
Quantity: 0, Quantity: 0,
PublisherFull: { PublisherFull: {