Skip to content

Commit

Permalink
hotfix - do not try to update mapping on doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitvidis committed Nov 30, 2016
1 parent 552ee01 commit 203d4d6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kuzzle-backoffice",
"version": "1.1.0",
"version": "1.1.1",
"description": "A handy back-office for Kuzzle.io",
"author": "The Kuzzle team <[email protected]>",
"private": false,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Common/Login/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="input-field col s12">
<input id="username" v-model="username" type="text" name="username" required tabindex="1"
class="validate" v-focus />
<label for="username" :class="{'active': username}">Email</label>
<label for="username" :class="{'active': username}">Login</label>
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -96,4 +96,4 @@
}
}
}
</script>
</script>
19 changes: 5 additions & 14 deletions src/components/Data/Documents/Update.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,13 @@
return kuzzle
.dataCollectionFactory(this.collection, this.index)
.dataMappingFactory(mapping || {})
.applyPromise()
.updateDocumentPromise(this.documentToEditId, this.newDocument)
.then(() => {
return kuzzle
.dataCollectionFactory(this.collection, this.index)
.updateDocumentPromise(this.documentToEditId, this.newDocument)
.then(() => {
kuzzle.refreshIndex(this.index)
this.$router.go({name: 'DataDocumentsList', params: {index: this.index, collection: this.collection}})
})
.catch((err) => {
this.error = 'An error occurred while trying to update the document: <br/> ' + err.message
})
kuzzle.refreshIndex(this.index)
this.$router.go({name: 'DataDocumentsList', params: {index: this.index, collection: this.collection}})
})
.catch(err => {
this.error = 'An error occurred while trying to update collection mapping according to the document: <br/> ' + err.message
.catch((err) => {
this.error = 'An error occurred while trying to update the document: <br/> ' + err.message
})
},
cancel () {
Expand Down
4 changes: 4 additions & 0 deletions src/services/documentFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export const getUpdatedSchema = (jsonDocument, collection) => {
}
} else {
type = typeof jsonDocument

if (type === 'number') {
type = Number.isInteger(jsonDocument) ? 'long' : 'double'
}
}

let property
Expand Down

0 comments on commit 203d4d6

Please sign in to comment.