Skip to content

Commit

Permalink
fix: small errors following last refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
albanm committed May 10, 2017
1 parent bc6112e commit 054d560
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions OpenApi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

<h2>Response</h2>
<pre>
{{currentResponse}}
{{currentResponse}}
</pre>
</md-layout>
</md-sidenav>
Expand Down Expand Up @@ -185,8 +185,10 @@ export default {
},
request() {
this.currentResponse = ''
request.fetch(this.currentRequest, this.selectedEntry, this.api).then(body => {
this.currentResponse = JSON.stringify(body, null, 2)
request.fetch(this.currentRequest, this.selectedEntry, this.api).then(res => {
this.currentResponse = JSON.stringify(res.body, null, 2)
}, res => {
this.currentResponse = JSON.stringify(res.body, null, 2)
})
}
}
Expand Down
4 changes: 3 additions & 1 deletion request.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Vue from 'vue'

exports.reset = (request, entry) => {
request.params = Object.assign({}, ...(entry.parameters || []).map(p => ({
[p.name]: p.schema.enum ? p.schema.enum[0] : (p.schema.type === 'array' ? [] : null)
Expand Down Expand Up @@ -33,5 +35,5 @@ exports.fetch = (request, entry, api) => {
httpRequest.headers['Content-type'] = request.contentType
httpRequest.body = request.requestBody
}
$http(httpRequest).then(response => response.body)
return Vue.http(httpRequest)
}
1 change: 0 additions & 1 deletion test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Vue.material.registerTheme('default', {
accent: 'red'
})

console.log(Vue.version)
new Vue({
el: '#app',
template: '<open-api :api="jsonApi" md-theme="\'default\'"></open-api>',
Expand Down

0 comments on commit 054d560

Please sign in to comment.