Skip to content

Commit

Permalink
* Adding Order number support as it's now required with the API.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSeg committed Mar 17, 2021
1 parent 920aa61 commit 71c1804
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/views/VinDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<label for="inputVinNumber" class="form-label">VIN</label>
<input id="inputVinNumber" v-model="inputVin" placeholder="1AABB12CDEF123456" pattern="[a-hj-npr-zA-HJ-NPR-Z0-9]{17}" type="text" class="form-control" maxlength="17" required style="text-transform:uppercase;" />
</div>
<div class="mb-3">
<label for="inputOrder" class="form-label">Order Number</label>
<input id="inputOrder" v-model="inputOrder" placeholder="1234" type="text" class="form-control" maxlength="17" required style="text-transform:uppercase;" />
</div>
<div class="mb-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
Expand All @@ -37,24 +41,29 @@ export default {
data () {
return {
inputVin: null,
inputOrder: null,
output: null
}
},
mounted () {
if (!this.inputVin && this.$route.query.vin) {
this.inputVin = this.$route.query.vin
}
if (this.inputVin) {
if (!this.inputOrder && this.$route.query.order) {
this.inputOrder = this.$route.query.order
}
if (this.inputVin && this.inputOrder) {
this.fetchVIN()
}
},
methods: {
fetchVIN () {
if (this.inputVin) {
if (this.inputVin && this.inputOrder) {
axios({
url: 'https://shop.ford.com/aemservices/shop/vot/api/customerorder/',
method: 'GET',
params: {
orderNumber: this.inputOrder.toUpperCase(),
partAttributes: 'BP2.*',
vin: this.inputVin.toUpperCase()
}
Expand Down

0 comments on commit 71c1804

Please sign in to comment.