Fixed an error where the book wasnt inserted when price or qty had a wrong value
This commit is contained in:
parent
d33dcdf05d
commit
1b428e557f
|
@ -17,7 +17,7 @@
|
|||
{{ success }}
|
||||
</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">
|
||||
<label>Title</label>
|
||||
<input name="title" placeholder="Title" type="text" v-model="book.Title" required>
|
||||
|
@ -36,11 +36,11 @@
|
|||
</div>
|
||||
<div class="field">
|
||||
<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 class="field">
|
||||
<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>
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<a class="ui blue button" type="submit" @click="insertNewBook()">Submit</a>
|
||||
<button class="ui blue button" type="submit">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -121,7 +121,7 @@
|
|||
Title: '',
|
||||
Isbn: '',
|
||||
Year: (new Date()).getFullYear(),
|
||||
Price: null,
|
||||
Price: 0,
|
||||
Status: 0,
|
||||
Quantity: 0,
|
||||
PublisherFull: {
|
||||
|
|
Loading…
Reference in New Issue