aboutsummaryrefslogtreecommitdiff
path: root/resources/js
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-03-21 23:11:56 +0100
committerMateja <mail@matejamaric.com>2021-03-21 23:11:56 +0100
commit4826b8d444db4f95baeead504fb816e7322ff026 (patch)
treec3856d60d14885257da782017f1f7438925c6f87 /resources/js
parent3d4617bac822b54c04eb2f19509aa77e8c7a3bfd (diff)
downloadyota-laravel-4826b8d444db4f95baeead504fb816e7322ff026.tar.gz
yota-laravel-4826b8d444db4f95baeead504fb816e7322ff026.zip
Add error handling to `call-sign-description.vue` component.
Diffstat (limited to 'resources/js')
-rw-r--r--resources/js/components/call-sign-description.vue10
1 files changed, 8 insertions, 2 deletions
diff --git a/resources/js/components/call-sign-description.vue b/resources/js/components/call-sign-description.vue
index 30cd37d..7ab8b64 100644
--- a/resources/js/components/call-sign-description.vue
+++ b/resources/js/components/call-sign-description.vue
@@ -2,7 +2,7 @@
<div>
<div class="form-group">
<label for="special-call">Special Callsign:</label>
- <select class="form-control" id="special-call" v-model="selected" name="scall" required>
+ <select class="form-control" :class="{ 'is-invalid': isInvalid }" id="special-call" v-model="selected" :name="name" required>
<option v-for="option in options" :key="option.id" :value="option.sign" v-text="option.sign"></option>
</select>
</div>
@@ -17,10 +17,16 @@
<script>
export default {
+ props: [ 'name', 'old', 'isInvalid' ],
mounted() {
this.$store.dispatch('pullSigns').then(() => {
try {
- this.$store.dispatch('setSelectedSign', this.$store.getters.getSigns[0].sign);
+ if (this.old) {
+ this.$store.dispatch('setSelectedSign', this.old);
+ }
+ else {
+ this.$store.dispatch('setSelectedSign', this.$store.getters.getSigns[0].sign);
+ }
}
catch {
console.log('No call signs!');