code review update id number, min length

This commit is contained in:
edmondlang
2021-10-21 15:50:31 +08:00
parent ba0dbf80a1
commit 25c36d085f
@@ -8,9 +8,9 @@
</div>
<div class="row">
<div class="col">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.orderNo">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.reference_id">
<label class="text-primary">Order Number</label>
<input class="form-control" name="orderNo" v-model="parameters.orderNo">
<input class="form-control" v-model="parameters.reference_id">
</validation-wrapper-component>
</div>
</div>
@@ -27,20 +27,28 @@
</template>
<script>
import modalFormHandler from '../../../general/mixins/modalFormHandler';
import { required } from "vuelidate/lib/validators";
import { required, minLength } from "vuelidate/lib/validators";
export default {
data() {
return {
parameters: {
id: this.data.id,
orderNo: this.orderNo,
reference_id: '',
}
};
},
validations: {
parameters: {
orderNo: { required },
reference_id: {
required,
minLength: minLength(8)
},
}
},
methods: {
successHandler(response) {
window.location.replace(this.route('order.show', response.payload.data.reference));
}
},
mixins: [modalFormHandler]